You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
543 lines
21 KiB
543 lines
21 KiB
<!DOCTYPE html>
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
|
<head>
|
|
<th:block th:include="include :: header('新增订单')" />
|
|
</head>
|
|
<body class="gray-bg">
|
|
<div class="container-div">
|
|
|
|
<div class="row">
|
|
<!--销售订单表单-->
|
|
<div class="col-sm-12 search-collapse">
|
|
<form id="formId">
|
|
<div class="select-list">
|
|
<form>
|
|
<div class="row" >
|
|
<div class="col-sm-6">
|
|
<div class="col-sm-12 form-group" >
|
|
<label>订单号:</label>
|
|
<input type="text" name="SaleorderNO" >
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>预约单号:</label>
|
|
<input type="text" >
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>客户代码:</label>
|
|
<input type="text" name="pCode" >
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>客户名称:</label>
|
|
<input type="text" name="pName" ></input>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>开单日期时间:</label>
|
|
<input type="text" class="time-input" placeholder="请选择" name="Plandate"/>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>联系人:</label>
|
|
<input type="text" name="pLinkman"/>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>客户厂房:</label>
|
|
<input type="text" name="Factory"/>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>联系电话:</label>
|
|
<input type="text" name="pTel"/>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>交货地点:</label>
|
|
<input type="text" name="sendAddress"/>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>订单编号:</label>
|
|
<input type="text" name="SaleorderID"/>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6" >
|
|
<div class="col-sm-12 form-group" >
|
|
<label>付款条件:</label>
|
|
<input type="text" name="GetMoneyMemo" >
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>交货条件:</label>
|
|
<select type="text" name="" >
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>交货方式:</label>
|
|
<select name="" >
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>接单日期:</label>
|
|
<input type="text" class="time-input" placeholder="请选择" name="writeDatetime"/>
|
|
</div>
|
|
<div class="col-sm-12">
|
|
<div class="col-sm-6 form-group" >
|
|
<label>修改日期:</label>
|
|
<input type="text" class="time-input" placeholder="请选择" name="editDate" style="width: 130px"/>
|
|
</div>
|
|
<div class="col-sm-6 form-group" >
|
|
<label>确认日期:</label>
|
|
<input type="text" class="time-input" placeholder="请选择" name="comfirmDate" style="width: 130px"/>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>接单方式:</label>
|
|
<select name="" >
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-12 form-group" >
|
|
<label>业务人员:</label>
|
|
<select name="Saler" >
|
|
</select>
|
|
</div>
|
|
<div class="col-sm-12 form-group" style="display: flex">
|
|
<label>备注 :</label>
|
|
<textarea class="form-control" style="width: 300px"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!--销售订单明细添加-->
|
|
<div class="btn-group-sm" id="toolbar" role="group">
|
|
<a class="btn btn-success" onclick="addBom()" shiro:hasPermission="finance:lsalesOrder:add">
|
|
<i class="fa fa-plus"></i> 添加成品
|
|
</a>
|
|
</div>
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
<table id="bootstrapTable-body"></table>
|
|
</div>
|
|
<!--成品选择弹框-->
|
|
<div class="modal inmodal" id="bomModal" tabindex="-1"
|
|
role="dilog" aria-hidden="true" style="padding-bottom: 100px;">
|
|
<div class="modal-dialog" style="width: 1200px">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">物料选择</h4>
|
|
</div>
|
|
<div class="modal-body" style="text-align: center;">
|
|
<div class="row" >
|
|
<div class="col-sm-10">
|
|
<form id="bomForm" class="form-group">
|
|
<div class="col-sm-4">
|
|
<label class="control-label col-md-4">成品代码:</label>
|
|
<div class=" col-md-8">
|
|
<input type="text" class="form-control" name="wlCode" id="wlCode">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<label class="control-label col-md-4">成品名称:</label>
|
|
<div class=" col-md-8">
|
|
<input type="text" class="form-control col-md-6" name="itemname" id="itemname">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="button" class="btn btn-success" id="bomCodeSearch">搜索</button>
|
|
<button type="button" class="btn btn-success" id="bomEmpty">清空</button>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="table-responsive" >
|
|
<table id="bomTable"
|
|
class="table table-striped table-responsive" style="padding-bottom: 50px;">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<button class="btn btn-success" id="btn_addWaitTable" onclick="addBom2()">添加</button>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="table-responsive" style="padding-bottom:30px; ">
|
|
<table id="bomTable2"
|
|
class="table table-striped table-responsive">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary"
|
|
onClick="confirm();">确定</button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<th:block th:include="include :: footer" />
|
|
<th:block th:include="include :: bootstrap-table-editable-js" />
|
|
<script th:inline="javascript">
|
|
var prefix = ctx + "finance/lsalesOrder";
|
|
|
|
|
|
// 打开成品选择框
|
|
function addBom(){
|
|
$("#bomModal").modal("show");
|
|
}
|
|
|
|
// 从全部物料表选择的
|
|
function addBom2(){
|
|
var row= $("#bomTable").bootstrapTable("getSelections");
|
|
var count = $('#bomTable2').bootstrapTable('getData').length;
|
|
for(var i=0;i<row.length;i++){
|
|
$("#bomTable2").bootstrapTable('insertRow', {index:count+i,
|
|
row:{
|
|
wldm:row[i].wldm,
|
|
wlCode:row[i].wlCode,
|
|
hsCode:row[i].hsCode,
|
|
itemname:row[i].itemname,
|
|
itemstandard:row[i].itemstandard,
|
|
machineNo:row[i].machineNo,
|
|
stockDw:row[i].stockDw,
|
|
intakeorchina:row[i].intakeorchina,
|
|
weight:row[i].weight,
|
|
pWldm:row[i].pWldm,
|
|
pCode:row[i].pCode,
|
|
pName:row[i].pName,
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
// 选择的物料单 即将添加为订单下的物料单
|
|
$('#bootstrapTable-body').bootstrapTable({
|
|
striped : true, // 是否显示行间隔色
|
|
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
// contentType :"application/x-www-form-urlencoded",
|
|
// pageNumber : 1, // 初始化加载第一页,默认第一页
|
|
// pageSize : 10, // 每页的记录行数(*)
|
|
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
|
|
// clickToSelect : true, // 是否启用点击选中行
|
|
showToggle : false, // 是否显示详细视图和列表视图的切换按钮
|
|
cardView : false, // 是否显示详细视图
|
|
detailView : false, // 是否显示父子表
|
|
smartDisplay : false, // 加了这个才显示每页显示的行数
|
|
showExport : false, // 是否显示导出按钮
|
|
singleSelect : true,
|
|
height:400,
|
|
columns: [
|
|
{
|
|
checkbox: true
|
|
},
|
|
{
|
|
field: 'wlCode',
|
|
title: '成品代码',
|
|
|
|
},
|
|
{
|
|
field: 'itemname',
|
|
title: '成品名称'
|
|
},
|
|
{
|
|
field: 'itemstandard',
|
|
title: '规格型号'
|
|
},
|
|
{
|
|
field: 'machineNo',
|
|
title: '机种',
|
|
},
|
|
{
|
|
field: 'stockDw',
|
|
title: '单位'
|
|
},
|
|
{
|
|
field: 'qty',
|
|
title: '数量',
|
|
editable : {
|
|
type : 'text',
|
|
title : '使用量',
|
|
validate : function(value) {
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
var price = parseFloat(value);
|
|
if (price <= 0) return '使用量必须大于0';
|
|
}
|
|
}
|
|
},
|
|
{
|
|
field: 'weight',
|
|
title: '重量'
|
|
},
|
|
{
|
|
field: 'crlName',
|
|
title: '币别'
|
|
},
|
|
{
|
|
field: 'price',
|
|
title: '单价'
|
|
},
|
|
{
|
|
field: 'amt',
|
|
title: '金额'
|
|
},
|
|
{
|
|
field: '',
|
|
title: '交期'
|
|
},
|
|
{
|
|
field: 'piNo',
|
|
title: 'Line#'
|
|
},
|
|
{
|
|
field: '',
|
|
title: '版本号'
|
|
},
|
|
{
|
|
field: '',
|
|
title: '说明'
|
|
},
|
|
{
|
|
title: '操作',
|
|
align: 'center',
|
|
formatter: function(value, row, index) {
|
|
var actions = [];
|
|
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.versionNo + '\')"><i class="fa fa-remove"></i>删除</a>');
|
|
return actions.join('');
|
|
}
|
|
}]
|
|
|
|
});
|
|
|
|
// 全部物料
|
|
$('#bomTable').bootstrapTable({
|
|
url : ctx + "ck/itemCP/itemList",
|
|
method : 'post',
|
|
striped : true, // 是否显示行间隔色
|
|
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
pagination : true, // 是否显示分页(*)
|
|
contentType :"application/x-www-form-urlencoded",
|
|
queryParams : function(params) {
|
|
var curParams = {
|
|
// 传递参数查询参数
|
|
pageSize: params.limit,
|
|
pageNum: params.offset / params.limit + 1,
|
|
searchValue: params.search,
|
|
orderByColumn: params.sort,
|
|
isAsc: params.order
|
|
};
|
|
var json= $.extend(curParams, $.common.formToJSON("bomForm"));
|
|
return json;
|
|
},
|
|
sidePagination : "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
pageNumber : 1, // 初始化加载第一页,默认第一页
|
|
pageSize : 5, // 每页的记录行数(*)
|
|
pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
|
|
clickToSelect : true, // 是否启用点击选中行
|
|
showToggle : false, // 是否显示详细视图和列表视图的切换按钮
|
|
cardView : false, // 是否显示详细视图
|
|
detailView : false, // 是否显示父子表
|
|
smartDisplay : false, // 加了这个才显示每页显示的行数
|
|
showExport : false, // 是否显示导出按钮
|
|
// singleSelect : true,
|
|
height:350,
|
|
columns : [
|
|
{
|
|
checkbox: true
|
|
},
|
|
{
|
|
field: 'wldm',
|
|
title: '',
|
|
visible: false
|
|
|
|
},
|
|
{
|
|
field: 'wlCode',
|
|
title: '物料代码'
|
|
},
|
|
{
|
|
field: 'hsCode',
|
|
title: '',
|
|
visible: false
|
|
|
|
},
|
|
{
|
|
field: 'itemname',
|
|
title: '名称'
|
|
},
|
|
{
|
|
field: 'enName',
|
|
title: '',
|
|
visible: false
|
|
|
|
},
|
|
{
|
|
field: 'itemstandard',
|
|
title: '规格型号'
|
|
},
|
|
{
|
|
field: 'machineNo',
|
|
title: '机种',
|
|
},
|
|
{
|
|
field: 'stockDw',
|
|
title: '库存单位'
|
|
},
|
|
{
|
|
field: 'intakeorchina',
|
|
title: '',
|
|
visible: false
|
|
},
|
|
{
|
|
field: 'weight',
|
|
title: '单位重量'
|
|
},
|
|
{
|
|
field: 'pWldm',
|
|
title: '客户料号'
|
|
},
|
|
{
|
|
field: 'pCode',
|
|
title: '客户号'
|
|
},
|
|
{
|
|
field: 'pName',
|
|
title: '客户名'
|
|
}
|
|
]
|
|
|
|
});
|
|
|
|
//要选择的物料
|
|
$('#bomTable2').bootstrapTable({
|
|
striped : true, // 是否显示行间隔色
|
|
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
// contentType :"application/x-www-form-urlencoded",
|
|
// pageNumber : 1, // 初始化加载第一页,默认第一页
|
|
// pageSize : 10, // 每页的记录行数(*)
|
|
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*)
|
|
// clickToSelect : true, // 是否启用点击选中行
|
|
showToggle : false, // 是否显示详细视图和列表视图的切换按钮
|
|
cardView : false, // 是否显示详细视图
|
|
detailView : false, // 是否显示父子表
|
|
smartDisplay : false, // 加了这个才显示每页显示的行数
|
|
showExport : false, // 是否显示导出按钮
|
|
singleSelect : true,
|
|
height:400,
|
|
columns : [
|
|
{
|
|
field: 'wldm',
|
|
title: '',
|
|
visible: false
|
|
|
|
},
|
|
{
|
|
field: 'wlCode',
|
|
title: '物料代码'
|
|
},
|
|
{
|
|
field: 'hsCode',
|
|
title: '',
|
|
visible: false
|
|
|
|
},
|
|
{
|
|
field: 'itemname',
|
|
title: '名称'
|
|
},
|
|
{
|
|
field: 'enName',
|
|
title: '',
|
|
visible: false
|
|
|
|
},
|
|
{
|
|
field: 'itemstandard',
|
|
title: '规格型号'
|
|
},
|
|
{
|
|
field: 'machineNo',
|
|
title: '机种',
|
|
},
|
|
{
|
|
field: 'stockDw',
|
|
title: '库存单位'
|
|
},
|
|
{
|
|
field: 'intakeorchina',
|
|
title: '',
|
|
visible: false
|
|
},
|
|
{
|
|
field: 'weight',
|
|
title: '单位重量'
|
|
},
|
|
{
|
|
field: 'pWldm',
|
|
title: '客户料号'
|
|
},
|
|
{
|
|
field: 'pCode',
|
|
title: '客户号'
|
|
},
|
|
{
|
|
field: 'pName',
|
|
title: '客户名'
|
|
},
|
|
{
|
|
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="edit()"><i class="fa fa-edit"></i>编辑</a> ');
|
|
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>');
|
|
return actions.join('');
|
|
}
|
|
}
|
|
]
|
|
|
|
});
|
|
|
|
//移除bomtable2的对应行数据
|
|
function remove(wlCode){
|
|
$("#bomTable2").bootstrapTable("remove",{
|
|
field:'wlCode',
|
|
values:wlCode
|
|
});
|
|
}
|
|
|
|
//添加到订单下确认
|
|
function confirm(){
|
|
var row=$("#bomTable2").bootstrapTable("getData",true);
|
|
var count = $('#bootstrapTable-body').bootstrapTable('getData').length;
|
|
//append方法
|
|
for(var i=0;i<row.length;i++){
|
|
$("#bootstrapTable-body").bootstrapTable('insertRow', {index:count+i,
|
|
row:{
|
|
wldm:row[i].wldm,
|
|
wlCode:row[i].wlCode,
|
|
hsCode:row[i].hsCode,
|
|
itemname:row[i].itemname,
|
|
itemstandard:row[i].itemstandard,
|
|
machineNo:row[i].machineNo,
|
|
stockDw:row[i].stockDw,
|
|
intakeorchina:row[i].intakeorchina,
|
|
weight:row[i].weight,
|
|
crlName:'RMB',
|
|
useNum:0,
|
|
lostpre:0
|
|
}
|
|
});
|
|
}
|
|
}
|
|
// function onDblClickRow (row) {
|
|
// console.log("这行订单号:" + row.saleorderNO)
|
|
// }
|
|
</script>
|
|
</body>
|
|
|