Browse Source

[feat]生产管理:修改新增生产委内入库单新增页面,新增查询销售订单类型查询,新增生产委内入库对象,新增入库委内加工单报价。

dev
zhangsiqi 5 months ago
parent
commit
421f06fcc1
  1. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeOrder.java
  3. 351
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/add.html
  4. 144
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html
  5. 316
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html
  6. 8
      ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html

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

@ -9,10 +9,12 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.service.IErpMaterialService; import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderDept; import com.ruoyi.system.domain.SysMakeorderDept;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.dto.SysEquipMaterialDto; import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.dto.SysMakeorderDeptDto; import com.ruoyi.system.dto.SysMakeorderDeptDto;
@ -52,6 +54,9 @@ public class SysMakeOrderController extends BaseController
@Autowired @Autowired
private ISysSalesOrderChildService salesOrderChildService; private ISysSalesOrderChildService salesOrderChildService;
@Autowired
private ISysSalesOrderService salesOrderService;
@GetMapping("/test") @GetMapping("/test")
public AjaxResult test(){ public AjaxResult test(){
sysMakeOrderService.generateMakeOrderBySalesOrderCode("XS20240411007"); sysMakeOrderService.generateMakeOrderBySalesOrderCode("XS20240411007");
@ -108,6 +113,10 @@ public class SysMakeOrderController extends BaseController
{ {
mmap.put("currentUser", ShiroUtils.getSysUser()); mmap.put("currentUser", ShiroUtils.getSysUser());
SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id); SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id);
SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo());
if(StringUtils.isNotNull(sysSalesOrder)){
sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType());
}
mmap.put("sysMakeOrder", sysMakeOrder); mmap.put("sysMakeOrder", sysMakeOrder);
return prefix + "/addPick"; return prefix + "/addPick";
} }
@ -120,6 +129,10 @@ public class SysMakeOrderController extends BaseController
{ {
mmap.put("currentUser", ShiroUtils.getSysUser()); mmap.put("currentUser", ShiroUtils.getSysUser());
SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id); SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id);
SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo());
if(StringUtils.isNotNull(sysSalesOrder)){
sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType());
}
mmap.put("sysMakeOrder", sysMakeOrder); mmap.put("sysMakeOrder", sysMakeOrder);
return prefix + "/addProcessInbound"; return prefix + "/addProcessInbound";
} }

13
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeOrder.java

@ -42,6 +42,8 @@ public class SysMakeOrder extends BaseEntity
@Excel(name = "关联销售订单号") @Excel(name = "关联销售订单号")
private String saleNo; private String saleNo;
@Excel(name = "订单类型")
private String orderType;
/** 业务员 */ /** 业务员 */
@Excel(name = "业务员") @Excel(name = "业务员")
private String Salesman; private String Salesman;
@ -158,7 +160,16 @@ public class SysMakeOrder extends BaseEntity
this.Salesman = Salesman; this.Salesman = Salesman;
} }
public String getSalesman()
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getSalesman()
{ {
return Salesman; return Salesman;
} }

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

@ -6,18 +6,6 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inboundOrder-add"> <form class="form-horizontal m" id="form-inboundOrder-add">
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label> <label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -30,39 +18,338 @@
<input name="saleNo" class="form-control" type="text"> <input name="saleNo" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">入库单号</label> <label class="col-sm-3 control-label">业务员</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="inboundOrderNo" class="form-control" type="text"> <input name="businessMembers" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">入库状态:</label> <label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<select name="inboundStatus" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="inboundType" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_type')}"> <select name="inboundType" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">入库数:</label>
<div class="col-sm-8">
<input name="inboundNum" class="form-control" type="text">
</div>
</div>
</form> </form>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "erp/inboundOrder" var editFlag = [[${@permission.hasPermi('erp:inboundOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('erp:inboundOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('erp:inboundOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('erp:inboundOrder:restore')}]];
var inboundStatusDatas = [[${@dict.getType('erp_inbound_status')}]];
var inboundTypeDatas = [[${@dict.getType('erp_inbound_type')}]];
var prefix = ctx + "erp/inboundOrder";
// 字典
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
// var subTableFormArray = [];
$(function(){
var options = {
url: ctx + "system/orderChild/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
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 + "erp/inboundOrderDetail/processDetaillist",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
inboundOrderNo: $("#inboundOrderNo").val(),
saleNo: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
},
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="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: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
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: 'completedNum',
title: '已完成数'
},
{
field: 'currentNum',
title: '本次委内完成数量'
},
{
field: 'processFeeUnitPrice',
title: '委内加工费单价'
},
{
field: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
visible: false,
},
{
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-inboundOrder-add").validate({ $("#form-inboundOrder-add").validate({
focusCleanup: true focusCleanup: true
}); });

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

@ -15,14 +15,31 @@
<input type="text" name="inboundOrderNo"/> <input type="text" name="inboundOrderNo"/>
</li> </li>
<li> <li>
<label>关联生单号:</label> <label>关联生单号:</label>
<input type="text" name="makeNo"/> <input type="text" name="makeNo"/>
</li> </li>
<li> <li>
<label>关联销售订单号:</label> <label>客户ID:</label>
<input type="text" name="saleNo"/> <input type="text" name="customerCode"/>
</li>
<li>
<label>客户公司名称:</label>
<input type="text" name="customerCompanyName"/>
</li>
<li>
<label>生产状态:</label>
<select name="inboundType" th:with="type=${@dict.getType('sys_erp_makeStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>使用状态:</label>
<select name="useStatus" th:with="type=${@dict.getType('useStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li> </li>
<li> <li>
<label>入库状态:</label> <label>入库状态:</label>
<select name="inboundStatus" th:with="type=${@dict.getType('erp_inbound_status')}"> <select name="inboundStatus" th:with="type=${@dict.getType('erp_inbound_status')}">
@ -31,12 +48,25 @@
</select> </select>
</li> </li>
<li> <li>
<label>入库类型</label> <label>品质状态</label>
<select name="inboundType" th:with="type=${@dict.getType('erp_inbound_type')}"> <select name="qualityStatus" th:with="type=${@dict.getType('qualityStatus')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</li> </li>
<li>
<label>品质状态:</label>
<select name="orderType" th:with="type=${@dict.getType('sys_order_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -55,10 +85,10 @@
</a> </a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:inboundOrder:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:inboundOrder:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a> -->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a>--> </a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
@ -86,60 +116,52 @@
restoreUrl: prefix + "/restore/{id}", restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
modalName: "入库单", modalName: "入库单",
columns: [{ columns: [
checkbox: true {checkbox: true},
}, {title: '主键ID',field: 'id',visible: false},
{ {title: '品质单号',field: ''},
title: '主键ID', {title: '品质状态',field: '',},
field: 'id', {title: '入库状态',field: 'inboundStatus',
visible: false formatter: function(value, row, index) {
}, return $.table.selectDictLabel(inboundStatusDatas, value);
{ }
title: '生产订单号', },
field: 'makeNo', {title: '入库单号',field: 'inboundOrderNo',},
}, {title: '关联生产订单号',field: 'makeNo',},
{ {title: '关联销售订单号',field: 'saleNo',visible: false,},
title: '关联销售订单号', {title: '生产订单类型',field: '',},
field: 'saleNo', {title: '入库类型',field: 'inboundType',
}, formatter: function(value, row, index) {
{ return $.table.selectDictLabel(inboundTypeDatas, value);
title: '入库单号', }
field: 'inboundOrderNo', },
}, {title: '客户ID',field: '',},
{ {title: '客户公司名称',field: '',},
title: '入库状态', {title: '客户订单号',field: '',},
field: 'inboundStatus', {title: '物料合计',field: '',},
formatter: function(value, row, index) { {title: '数量合计',field: '',},
return $.table.selectDictLabel(inboundStatusDatas, value); {title: '委内加工费总价',field: '',},
} {title: '品质合格数',field: '',},
}, {title: '品项不合格数',field: '',},
{ {title: '入库数',field: 'inboundNum',},
title: '入库类型', {title: '录入人',field: 'inboundUser',},
field: 'inboundType', {title: '录入时间',field: 'inboundTime',},
formatter: function(value, row, index) { {title: '更新人',field: '',},
return $.table.selectDictLabel(inboundTypeDatas, value); {title: '上次更新时间',field: '',},
} {title: '操作', align: 'center',formatter: function(value, row, index) {
}, var actions = [];
{ /*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
title: '入库数', 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> ');
field: 'inboundNum', if(row.delFlag == '0'){
}, actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
{ }else{
title: '操作', 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> ');
align: 'center', }*/
formatter: function(value, row, index) { 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> ');
var actions = []; return actions.join('');
/*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); }
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.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}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> ');
}*/
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> ');
return actions.join('');
} }
}] ]
}; };
$.table.init(options); $.table.init(options);
}); });

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

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

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

@ -28,20 +28,20 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">订单类型:</label> <label class="col-sm-3 control-label is-required">订单类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select disabled name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required> <select name="orderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" th:field="*{orderType}" required>
<option value="">请选择</option> <option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option> <option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select> </select>
</div> </div>
</div> </div>
</form>
<div class="container">
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table> <table id="bootstrap-sub-table-1"></table>
</div> </div>
</div> </div>
</div>
</form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />

Loading…
Cancel
Save