提交 bbb035d9 编写于 作者: doc_wei's avatar doc_wei

工艺路线管理托管到布局

上级 7eba8f2e
......@@ -18,6 +18,7 @@ layui.config({
} else {
checkType = GetUrlParam("checkType");
}
var procedureId = GetUrlParam("procedureId");
//设置提示信息
var s = "车间选择规则:";
......@@ -28,12 +29,15 @@ layui.config({
//显示保存按钮
$("#saveCheckBox").show();
}
if (!isNull(procedureId)) {
s += '2.包含指定工序的车间可以选择;';
}
s += '如没有查到要选择的车间,请检查车间信息是否满足当前规则。';
$("#showInfo").html(s);
initTable();
function initTable(){
if(checkType == '2'){
if (checkType == '2') {
var ids = [];
$.each(parent.farmMationList, function(i, item) {
ids.push(item.id);
......@@ -65,15 +69,25 @@ layui.config({
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("commonEnable", 'id', d.enabled, 'name');
}}
]],
done: function(res, curr, count){
done: function(res, curr, count) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, res.searchFilter, form, "请输入名称、车间编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
if(checkType == '1'){
if (checkType == '1') {
for (var i = 0; i < res.rows.length; i++) {
// 未启用/指定工序该车间没有的设置为不可选中
if (res.rows[i].enabled != 1) {
systemCommonUtil.disabledRow(res.rows[i].LAY_TABLE_INDEX, 'radio');
}
if (!isNull(procedureId) && getInPoingArr(res.rows[i].workProcedureList, "procedureId", procedureId) == null) {
systemCommonUtil.disabledRow(res.rows[i].LAY_TABLE_INDEX, 'radio');
}
}
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('dblclick',function(){
var dubClick = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
if (!dubClick.find("input[type='radio']").prop("disabled")) {
dubClick.find("input[type='radio']").prop("checked", true);
form.render();
var chooseIndex = JSON.stringify(dubClick.data('index'));
......@@ -82,14 +96,26 @@ layui.config({
parent.refreshCode = '0';
parent.layer.close(index);
}
});
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('click',function(){
var click = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
if (!click.find("input[type='radio']").prop("disabled")) {
click.find("input[type='radio']").prop("checked", true);
form.render();
}
})
} else {
for (var i = 0; i < res.rows.length; i++) {
// 未启用/指定工序该车间没有的设置为不可选中
if (res.rows[i].enabled != 1) {
systemCommonUtil.disabledRow(res.rows[i].LAY_TABLE_INDEX, 'checkbox');
}
if (!isNull(procedureId) && getInPoingArr(res.rows[i].workProcedureList, "procedureId", procedureId) == null) {
systemCommonUtil.disabledRow(res.rows[i].LAY_TABLE_INDEX, 'checkbox');
}
}
// 多选
tableCheckBoxUtil.checkedDefault({
gridId: 'messageTable',
......
// 工序选择必备参数
var procedureCheckType = 1;//工序选择类型:1.单选procedureMation;2.多选procedureMationList
var procedureMation = {};
// 车间选择必备参数
var farmCheckType = 1;//车间选择类型:1.单选procedureMation;2.多选procedureMationList
var farmMation = {};
var procedureId = "";
// 工艺路线管理---新增工艺路线
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'soulTable', 'table'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table,
soulTable = layui.soulTable;
var procedureList = new Array();
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'get',
data: procedureList,
even: true,
page: false,
rowDrag: {
trigger: 'row',
done: function(obj) {}
},
cols: [[
{ type: 'checkbox', align: 'center' },
{ field: 'number', title: '工序编号', align: 'left', width: 120, templet: function (d) {
return '<input type="text" id="procedureId' + d.id + '" placeholder="请选择工序" class="layui-input" readonly="readonly" ' +
'value="' + (isNull(d.number) ? "" : d.number) + '"/>' +
'<i class="fa fa-plus-circle input-icon chooseProcedureBtn" style="top: 8px;"></i>';
}},
{ field: 'procedureName', title: '工序名称', align: 'left', width: 120},
{ field: 'unitPrice', title: '加工单价', align: 'left', width: 120},
{ field: 'departmentName', title: '加工部门', align: 'left', width: 120},
{ field: 'farmId', title: '加工车间', align: 'left', width: 120, templet: function (d) {
return '<input type="text" id="farmId' + d.id + '" placeholder="请选择车间" class="layui-input" readonly="readonly" ' +
'value="' + (isNull(d.farmName) ? "" : d.farmName) + '"/>' +
'<i class="fa fa-plus-circle input-icon chooseFarmBtn" style="top: 8px;"></i>';
}}
]],
done: function(json) {
matchingLanguage();
soulTable.render(this);
}
});
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if(table.cache.messageTable.length == 0){
winui.window.msg('请最少选择一条工序.', {icon: 2, time: 2000});
return false;
}
var params = {
wayNumber: $("#wayNumber").val(),
wayName: $("#wayName").val(),
procedureMation: JSON.stringify(table.cache.messageTable)
};
AjaxPostUtil.request({url: flowableBasePath + "erpwayprocedure002", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
$("body").on("click", "#addRow", function() {
addRow();
});
$("body").on("click", "#deleteRow", function() {
deleteRow();
});
// 新增行
var rowNum = 1;
function addRow() {
procedureList = [].concat(table.cache.messageTable);
procedureList.push({id: rowNum});
table.reloadData("messageTable", {data: procedureList});
rowNum++;
}
// 删除行
function deleteRow() {
procedureList = [].concat(table.cache.messageTable);
var check_box = table.checkStatus('messageTable').data;
for (var i = 0; i < check_box.length; i++){
var list = [];
$.each(procedureList, function(j, item) {
if(item.id != check_box[i].id){
list.push(item);
}
});
procedureList = [].concat(list);
}
table.reloadData("messageTable", {data: procedureList});
}
// 工序选择
$("body").on("click", ".chooseProcedureBtn", function() {
var trId = $(this).parent().find("input").attr("id").replace("procedureId", "");
_openNewWindows({
url: "../../tpl/erpWorkProcedure/erpWorkProcedureChoose.html",
title: "工序选择",
pageId: "erpWorkProcedureChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
loadUseTableMation(trId, procedureMation);
}});
});
function loadUseTableMation(trId, procedureMation){
var inIndex = -1;
$.each(procedureList, function(j, item) {
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
var procedure = $.extend(procedureList[inIndex], procedureMation);
procedure.farmId = '';
procedure.farmName = '';
procedureList[inIndex] = procedure;
}
table.reloadData("messageTable", {data: procedureList});
}
// 车间选择
$("body").on("click", ".chooseFarmBtn", function() {
var trId = $(this).parent().find("input").attr("id").replace("farmId", "");
var row = getProcedureMation(trId);
if(isNull(row.procedureId)){
winui.window.msg('请先选择工序', {icon: 2, time: 2000});
return;
}
procedureId = row.procedureId;
_openNewWindows({
url: "../../tpl/erpFarm/erpFarmChoose.html",
title: "车间选择",
pageId: "erpFarmChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
loadFarmUseTableMation(trId, farmMation);
}});
});
function loadFarmUseTableMation(trId, farmMation){
var inIndex = -1;
$.each(procedureList, function(j, item) {
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
var farm = procedureList[inIndex];
farm.farmId = farmMation.farmId;
farm.farmName = farmMation.farmName;
procedureList[inIndex] = farm;
}
table.reloadData("messageTable", {data: procedureList});
}
function getProcedureMation(trId){
var inIndex = -1;
$.each(procedureList, function(j, item) {
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
return procedureList[inIndex];
}
return {};
}
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
......@@ -15,58 +15,58 @@ layui.config({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'erpwayprocedure009',
url: sysMainMation.erpBasePath + 'erpwayprocedure001',
where: getTableParams(),
even: true,
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
limit: 8,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ type: 'radio'},
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'wayNumber', title: '工艺编号', align: 'left', width: 100, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.wayNumber + '</a>';
}},
{ field: 'wayName', title: '工艺名称', align: 'left', width: 250},
{ field: 'number', title: '工艺编号', align: 'left', width: 100 },
{ field: 'name', title: '工艺名称', align: 'left', width: 200 },
{ field: 'enabled', title: '状态', align: 'center', width: 80, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("commonEnable", 'id', d.enabled, 'name');
}}
]],
done: function(res, curr, count){
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, res.searchFilter, form, "请输入名称、编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
for (var i = 0; i < res.rows.length; i++) {
// 未启用的设置为不可选中
if (res.rows[i].enabled != 1) {
systemCommonUtil.disabledRow(res.rows[i].LAY_TABLE_INDEX, 'radio');
}
}
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('dblclick',function(){
var dubClick = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
if (!dubClick.find("input[type='radio']").prop("disabled")) {
dubClick.find("input[type='radio']").prop("checked", true);
form.render();
var id = JSON.stringify(dubClick.data('index'));
// 工艺信息
parent.wayProcedureMation = res.rows[id];
parent.layer.close(index);
var chooseIndex = JSON.stringify(dubClick.data('index'));
var obj = res.rows[chooseIndex];
parent.wayProcedureMation = obj;
parent.refreshCode = '0';
parent.layer.close(index);
}
});
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('click',function(){
var click = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
if (!click.find("input[type='radio']").prop("disabled")) {
click.find("input[type='radio']").prop("checked", true);
form.render();
})
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'details'){ //详情
details(data);
})
}
});
// 搜索表单
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()})
}
return false;
});
$("body").on("click", "#reloadTable", function() {
loadTable();
});
......@@ -75,11 +75,8 @@ layui.config({
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams(){
return {
wayNumber: $("#wayNumber").val(),
wayName: $("#wayName").val()
};
function getTableParams() {
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('erpWayProcedureChoose', {});
......
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'table'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table;
var procedureList = new Array();
var rowNum = 1;
showGrid({
id: "showForm",
url: flowableBasePath + "erpwayprocedure008",
params: {rowId: parent.rowId},
pagination: false,
method: "GET",
template: $("#usetableTemplate").html(),
ajaxSendLoadBefore: function(hdb) {
},
ajaxSendAfter: function (json) {
$.each(json.bean.procedureList, function(j, item) {
item.id = rowNum;
procedureList.push(item);
rowNum++;
});
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'get',
data: procedureList,
even: true,
page: false,
rowDrag: {
trigger: 'row',
done: function(obj) {}
},
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'number', title: '工序编号', align: 'left', width: 120},
{ field: 'procedureName', title: '工序名称', align: 'left', width: 120},
{ field: 'unitPrice', title: '加工单价', align: 'left', width: 120},
{ field: 'departmentName', title: '加工部门', align: 'left', width: 120},
{ field: 'farmName', title: '加工车间', align: 'left', width: 120}
]],
done: function(json) {
}
});
matchingLanguage();
form.render();
}
});
});
});
\ No newline at end of file
// 工序选择必备参数
var procedureCheckType = 1;//工序选择类型:1.单选procedureMation;2.多选procedureMationList
var procedureMation = {};
// 车间选择必备参数
var farmCheckType = 1;//车间选择类型:1.单选procedureMation;2.多选procedureMationList
var farmMation = {};
var procedureId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'soulTable', 'table'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table,
soulTable = layui.soulTable;
var procedureList = new Array();
var rowNum = 1;
showGrid({
id: "showForm",
url: flowableBasePath + "erpwayprocedure003",
params: {rowId: parent.rowId},
pagination: false,
template: $("#usetableTemplate").html(),
ajaxSendLoadBefore: function(hdb) {
},
ajaxSendAfter: function (json) {
$.each(json.bean.procedureList, function(j, item) {
item.id = rowNum;
procedureList.push(item);
rowNum++;
});
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'get',
data: procedureList,
even: true,
page: false,
rowDrag: {
trigger: 'row',
done: function(obj) {}
},
cols: [[
{ type: 'checkbox', align: 'center' },
{ field: 'number', title: '工序编号', align: 'left', width: 120, templet: function (d) {
return '<input type="text" id="procedureId' + d.id + '" placeholder="请选择工序" class="layui-input" readonly="readonly" ' +
'value="' + (isNull(d.number) ? "" : d.number) + '"/>' +
'<i class="fa fa-plus-circle input-icon chooseProcedureBtn" style="top: 8px;"></i>';
}},
{ field: 'procedureName', title: '工序名称', align: 'left', width: 120},
{ field: 'unitPrice', title: '加工单价', align: 'left', width: 120},
{ field: 'departmentName', title: '加工部门', align: 'left', width: 120},
{ field: 'farmId', title: '加工车间', align: 'left', width: 120, templet: function (d) {
return '<input type="text" id="farmId' + d.id + '" placeholder="请选择车间" class="layui-input" readonly="readonly" ' +
'value="' + (isNull(d.farmName) ? "" : d.farmName) + '"/>' +
'<i class="fa fa-plus-circle input-icon chooseFarmBtn" style="top: 8px;"></i>';
}}
]],
done: function(json) {
matchingLanguage();
soulTable.render(this);
}
});
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if(table.cache.messageTable.length == 0){
winui.window.msg('请最少选择一条工序.', {icon: 2, time: 2000});
return false;
}
var params = {
wayNumber: $("#wayNumber").val(),
wayName: $("#wayName").val(),
procedureMation: JSON.stringify(table.cache.messageTable),
rowId: parent.rowId
};
AjaxPostUtil.request({url: flowableBasePath + "erpwayprocedure004", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
}
});
$("body").on("click", "#addRow", function() {
addRow();
});
$("body").on("click", "#deleteRow", function() {
deleteRow();
});
// 新增行
function addRow() {
procedureList = [].concat(table.cache.messageTable);
procedureList.push({id: rowNum});
table.reloadData("messageTable", {data: procedureList});
rowNum++;
}
// 删除行
function deleteRow() {
procedureList = [].concat(table.cache.messageTable);
var check_box = table.checkStatus('messageTable').data;
for (var i = 0; i < check_box.length; i++){
var list = [];
$.each(procedureList, function(j, item) {
if(item.id != check_box[i].id){
list.push(item);
}
});
procedureList = [].concat(list);
}
table.reloadData("messageTable", {data: procedureList});
}
// 工序选择
$("body").on("click", ".chooseProcedureBtn", function() {
var trId = $(this).parent().find("input").attr("id").replace("procedureId", "");
_openNewWindows({
url: "../../tpl/erpWorkProcedure/erpWorkProcedureChoose.html",
title: "工序选择",
pageId: "erpWorkProcedureChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
loadUseTableMation(trId, procedureMation);
}});
});
function loadUseTableMation(trId, procedureMation){
var inIndex = -1;
$.each(procedureList, function(j, item) {
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
var procedure = $.extend(procedureList[inIndex], procedureMation);
procedure.farmId = '';
procedure.farmName = '';
procedureList[inIndex] = procedure;
}
table.reloadData("messageTable", {data: procedureList});
}
// 车间选择
$("body").on("click", ".chooseFarmBtn", function() {
var trId = $(this).parent().find("input").attr("id").replace("farmId", "");
var row = getProcedureMation(trId);
if(isNull(row.procedureId)){
winui.window.msg('请先选择工序', {icon: 2, time: 2000});
return;
}
procedureId = row.procedureId;
_openNewWindows({
url: "../../tpl/erpFarm/erpFarmChoose.html",
title: "车间选择",
pageId: "erpFarmChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
loadFarmUseTableMation(trId, farmMation);
}});
});
function loadFarmUseTableMation(trId, farmMation){
var inIndex = -1;
$.each(procedureList, function(j, item) {
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
var farm = procedureList[inIndex];
farm.farmId = farmMation.farmId;
farm.farmName = farmMation.farmName;
procedureList[inIndex] = farm;
}
table.reloadData("messageTable", {data: procedureList});
}
function getProcedureMation(trId){
var inIndex = -1;
$.each(procedureList, function(j, item) {
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
return procedureList[inIndex];
}
return {};
}
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'soulTable'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
soulTable = layui.soulTable,
table = layui.table;
authBtn('1599382490718');// 新增
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'erpwayprocedure001',
where: getTableParams(),
even: true,
page: true,
overflow: {
type: 'tips',
hoverTime: 300, // 悬停时间,单位ms, 悬停 hoverTime 后才会显示,默认为 0
minWidth: 150, // 最小宽度
maxWidth: 500 // 最大宽度
},
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'wayNumber', title: '工艺编号', align: 'left', width: 100, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.wayNumber + '</a>';
}},
{ field: 'wayName', title: '工艺名称', align: 'left', width: 250},
{ field: 'state', title: '状态', align: 'left', width: 80, templet: function (d) {
if(d.state == '1'){
return "<span class='state-down'>禁用</span>";
} else if (d.state == '2'){
return "<span class='state-up'>启用</span>";
} else {
return "参数错误";
}
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 100 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: '最后修改时间', align: 'center', width: 100},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar'}
]],
done: function(json) {
matchingLanguage();
soulTable.render(this);
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'delete') { // 删除
deletemember(data);
} else if (layEvent === 'details') { // 详情
details(data);
} else if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'norms') { // 正常
norms(data);
} else if (layEvent === 'rectification') { // 维修整改
rectification(data);
}
});
// 搜索表单
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()})
}
return false;
});
// 编辑
function edit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpWayProcedure/erpWayProcedureEdit.html",
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "erpWayProcedureEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 删除
function deletemember(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
AjaxPostUtil.request({url: flowableBasePath + "erpwayprocedure007", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 详情
function details(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpWayProcedure/erpWayProcedureDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "erpWayProcedureDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 启用
function norms(data) {
layer.confirm(systemLanguage["com.skyeye.enableOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.enableOperation"][languageType]}, function(index) {
AjaxPostUtil.request({url: flowableBasePath + "erpwayprocedure006", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.enableOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 禁用
function rectification(data) {
layer.confirm(systemLanguage["com.skyeye.disableOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.disableOperation"][languageType]}, function(index) {
AjaxPostUtil.request({url: flowableBasePath + "erpwayprocedure005", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.disableOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
//添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/erpWayProcedure/erpWayProcedureAdd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "erpWayProcedureAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
$("body").on("click", "#reloadTable", function() {
loadTable();
});
//刷新
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams(){
return {
wayNumber: $("#wayNumber").val(),
wayName: $("#wayName").val()
};
}
exports('erpWayProcedureList', {});
});
......@@ -73,7 +73,7 @@ layui.config({
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
if(checkType == '1'){
if (checkType == '1') {
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('dblclick',function(){
var dubClick = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
dubClick.find("input[type='radio']").prop("checked", true);
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<style type="text/css">
.layui-table-cell {
height: auto;
}
</style>
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">工艺信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工艺编号<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="wayNumber" name="wayNumber" win-verify="required" placeholder="请填写工艺编号" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工艺名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="wayName" name="wayName" placeholder="请填写工艺名称" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">加工工序</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">工序资料<i class="red">*</i></label>
<div class="layui-input-block">
<div class="winui-tip alert-info">
拖拽表格行可修改工序顺序。
</div>
<div class="winui-tool" style="text-align: left;">
<button id="addRow" class="winui-toolbtn" type="button"><i class="fa fa-plus" aria-hidden="true"></i>新增行</button>
<button id="deleteRow" class="winui-toolbtn" type="button"><i class="fa fa-trash-o" aria-hidden="true"></i>删除行</button>
</div>
<table class="layui-table" id="messageTable">
</table>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpWayProcedure/'}).use('erpWayProcedureAdd');
</script>
</body>
</html>
\ No newline at end of file
......@@ -7,27 +7,9 @@
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">工艺编号</label>
<div class="layui-input-inline">
<input type="text" id="wayNumber" name="wayNumber" placeholder="请输入工艺编号" class="layui-input" />
</div>
<label class="layui-form-label">工艺名称</label>
<div class="layui-input-inline">
<input type="text" id="wayName" name="wayName" placeholder="请输入工艺名称" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script type="text/x-handlebars-template" id="usetableTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">工艺信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工艺编号</label>
<div class="layui-input-block ver-center">
{{wayNumber}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工艺名称</label>
<div class="layui-input-block ver-center">
{{wayName}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">加工工序</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">工序资料</label>
<div class="layui-input-block">
<table class="layui-table" id="messageTable">
</table>
</div>
</div>
{{/bean}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpWayProcedure/'}).use('erpWayProcedureDetails');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<style type="text/css">
.layui-table-cell {
height: auto;
}
</style>
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script type="text/x-handlebars-template" id="usetableTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">工艺信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工艺编号<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="wayNumber" name="wayNumber" win-verify="required" placeholder="请填写工艺编号" class="layui-input" value="{{wayNumber}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工艺名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="wayName" name="wayName" placeholder="请填写工艺名称" class="layui-input" value="{{wayName}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">加工工序</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">工序资料<i class="red">*</i></label>
<div class="layui-input-block">
<div class="winui-tip alert-info">
拖拽表格行可修改工序顺序
</div>
<div class="winui-tool" style="text-align: left;">
<button id="addRow" class="winui-toolbtn" type="button"><i class="fa fa-plus" aria-hidden="true"></i>新增行</button>
<button id="deleteRow" class="winui-toolbtn" type="button"><i class="fa fa-trash-o" aria-hidden="true"></i>删除行</button>
</div>
<table class="layui-table" id="messageTable">
</table>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpWayProcedure/'}).use('erpWayProcedureEdit');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">工艺编号</label>
<div class="layui-input-inline">
<input type="text" id="wayNumber" name="wayNumber" placeholder="请输入工艺编号" class="layui-input" />
</div>
<label class="layui-form-label">工艺名称</label>
<div class="layui-input-inline">
<input type="text" id="wayName" name="wayName" placeholder="请输入工艺名称" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn" auth="1599382490718"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(auth('1599382499127')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if((d.state == '1' || d.state == '2') && auth('1599382521755')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# if(d.state == '1' && auth('1599382514030')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="norms"><language showName="com.skyeye.enableBtn"></language></a>
{{# } }}
{{# if(d.state == '2' && auth('1599382506859')) { }}
<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="rectification"><language showName="com.skyeye.disableBtn"></language></a>
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpWayProcedure/'}).use('erpWayProcedureList');
</script>
</body>
</html>
\ No newline at end of file
......@@ -781,6 +781,9 @@ function judgeInPoingArr(array, key, value) {
* @returns {null|*}
*/
function getInPoingArr(array, key, value, getKey) {
if (array == null) {
return null;
}
for(var i = 0; i < array.length; i++){
if(array[i][key] == value){
if(isNull(getKey)){
......
......@@ -201,6 +201,7 @@ var initTableChooseUtil = {
row[bean.id] = value;
});
row["sortNo"] = i;
row["orderBy"] = i;
dataList.push(row);
});
var checkResult = true;
......@@ -285,7 +286,9 @@ var initTableChooseUtil = {
$("#" + tdId).attr("data-id", value);
var key = dsFormUtil.getKeyIdToMation(bean.id);
value = data[key];
if (!isNull(value)) {
$("#" + tdId).val(value.name || value.title);
}
} else if (formType == 'select') {
if (!isNull(value["html"])) {
$("#" + tdId).html(value["html"]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册