@ -7,7 +7,7 @@
< / head >
< body class = "white-bg" >
< div id = "app" class = "wrapper wrapper-content animated fadeInRight ibox-content" >
< form class = "form-horizontal m" id = "form-material-edit " th:object = "${erpMaterial}" >
< form class = "form-horizontal m" id = "form-material-detail " th:object = "${erpMaterial}" >
< input name = "id" th:field = "*{id}" type = "hidden" >
< div class = "form-group" >
< label class = "col-sm-3 control-label" > 料号:< / label >
@ -21,24 +21,6 @@
< input name = "materialName" th:field = "*{materialName}" class = "form-control" type = "text" disabled / >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label" > 审核状态:< / label >
< div class = "col-sm-8" >
< div class = "radio-box" th:each = "dict : ${@dict.getType('auditStatus')}" >
< input type = "radio" readonly th:id = "${'auditStatus_' + dict.dictCode}" name = "auditStatus" th:value = "${dict.dictValue}" th:field = "*{auditStatus}" >
< label th:for = "${'auditStatus_' + dict.dictCode}" th:text = "${dict.dictLabel}" > < / label >
< / div >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label" > 使用状态:< / label >
< div class = "col-sm-8" >
< div class = "radio-box" readonly th:each = "dict : ${@dict.getType('useStatus')}" >
< input type = "radio" th:id = "${'useStatus_' + dict.dictCode}" name = "useStatus" th:value = "${dict.dictValue}" th:field = "*{useStatus}" >
< label th:for = "${'useStatus_' + dict.dictCode}" th:text = "${dict.dictLabel}" > < / label >
< / div >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label" > 物料类型:< / label >
< div class = "col-sm-8" >
@ -92,7 +74,7 @@
< div class = "form-group" >
< label class = "col-sm-3 control-label" > 工程员:< / label >
< div class = "col-sm-8" >
< select name = "businessMembers" id = "businessMembers_add " class = "form-control m-b" required >
< select name = "businessMembers" th:f iel d= "*{businessMembers}" id = "businessMembers_edit " class = "form-control m-b" required >
< / select >
< / div >
< / div >
@ -150,6 +132,23 @@
< script th:src = "@{/ajax/libs/vue/vue.js}" > < / script >
< script th:src = "@{/ajax/libs/element-ui/element-ui.js}" > < / script >
< script th:inline = "javascript" >
$(function(){
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("form-material-detail select[name='businessMembers']").append(
"< option value = '" + usertData[i].userName + "' > " + usertData[i].userName + "< / option > ");
}
} else {
$.modal.msgError(res.msg);
}
}
});
});
new Vue({
el: '#app',
data: function() {
@ -257,29 +256,18 @@
var prefix = ctx + "erp/material";
$(function(){
var id = $("#id").val();
var materialNo = $("#materialNo").val();
// 技术团队人员信息
$('#item-table').bootstrapTable('destroy');
$('#item-table').bootstrapTable({
url: ctx + "/system/item/list",
pagination: true,
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
var option1 = {
id: "item-table",
showSearch: false,
showRefresh: false,
method: "post",
contentType: "application/json",
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo',
height: 150,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: function (params) {
//console.log("123");
var curParams = {
@ -361,37 +349,26 @@
return actions.join('');
}
}]
});
};
$.table.init(option1);
// 销售价历史
$('#xiaoshou-table').bootstrapTable('destroy');
$('#xiaoshou-table').bootstrapTable({
url: '/sales/salesOrderDetail/list',
pagination: true,
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
var option2 ={
id: "xiaoshou-table",
showSearch: false,
showRefresh: false,
method: "post",
contentType: "application/json",
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo',
height: 150,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: $("# materialNo").val()
finishProductCode: materialNo
};
return curParams
},
@ -615,37 +592,26 @@
title: '对账时间',
visible: false
}]
});
};
$.table.init(option2);
//采购价历史
$('#purser-table').bootstrapTable('destroy');
$('#purser-table').bootstrapTable({
url: '/purchase/purchaseMaterial/list',
pagination: true,
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
var option3 = {
id: 'purser-table',
showSearch: false,
showRefresh: false,
method: "post",
contentType: "application/x-www-form-urlencoded",
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo',
height: 150,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
materialCode: $("# materialNo").val()
materialCode: materialNo
};
return curParams
},
@ -712,114 +678,77 @@
title: '说明'
}
]
});
};
$.table.init(option3);
//操作历史
$('#oper-table').bootstrapTable('destroy');
$('#oper-table').bootstrapTable({
url: '/system/customer/operList',
pagination: true,
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
showRefresh: false,
method: "post",
contentType: "application/x-www-form-urlencoded",
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo',
height: 150,
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
enterpriseCode: $("#materialNo").val()
};
// console.log(data[0].enterpriseCode)
return curParams
},
columns: [
{
field: 'id',
title: '操作历史记录id',
visible: false
},
{
field: 'enterpriseCode',
title: '物料编号',
visible: false
},
{
field: 'enterpriseName',
title: '物料名称',
},
{
field: 'purser',
title: '事业部'
},
{
field: 'operPeople',
title: '操作人'
},
{
field: 'oper',
field: '操作'
},
{
field: 'createTime',
field: '操作时间',
var option4 = {
id: 'oper-table',
url: '/system/customer/operList',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
enterpriseCode: materialNo
};
// console.log(data[0].enterpriseCode)
return curParams
},
columns: [
{
field: 'id',
title: '操作历史记录id',
visible: false
},
{
field: 'enterpriseCode',
title: '物料编号',
visible: false
},
{
field: 'enterpriseName',
title: '物料名称',
},
{
field: 'purser',
title: '事业部'
},
{
field: 'operPeople',
title: '操作人'
},
{
field: 'oper',
field: '操作'
},
{
field: 'createTime',
field: '操作时间',
},{
field: 'operStatus',
title: '操作状态',
formatter: function (value,index,row){
if (value == 0){
return '成功';
}else{
return '失败';
}
},{
field: 'operStatus',
title: '操作状态',
formatter: function (value,index,row){
if (value == 0){
return '成功';
}else{
return '失败';
}
}
]
});
});
$("#form-material-edit").validate({
onkeyup: false,
rules:{
materialNo:{
isInteger: true,
minlength: 10,
maxlength: 10,
},
},
messages: {
"materialNo": {
// remote: "料号已经存在",
minlength: "请输入10位整数",
maxlength: "请输入10位整数",
},
},
focusCleanup: true
}
]
};
$.table.init(option4);
});
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType);
$.operate.save(prefix + "/edit", $('#form-material-edit').serialize());
}
}
< / script >
< / body >
< / html >