From bbb035d96d9484536b17120e06b57bec1e797593 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sun, 16 Apr 2023 13:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=89=98=E7=AE=A1=E5=88=B0=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/erpFarm/erpFarmChoose.js | 52 +++-- .../js/erpWayProcedure/erpWayProcedureAdd.js | 200 ---------------- .../erpWayProcedure/erpWayProcedureChoose.js | 81 ++++--- .../erpWayProcedure/erpWayProcedureDetails.js | 63 ----- .../js/erpWayProcedure/erpWayProcedureEdit.js | 218 ------------------ .../js/erpWayProcedure/erpWayProcedureList.js | 172 -------------- .../erpWorkProcedureChoose.js | 2 +- .../erpWayProcedure/erpWayProcedureAdd.html | 66 ------ .../erpWayProcedureChoose.html | 26 +-- .../erpWayProcedureDetails.html | 53 ----- .../erpWayProcedure/erpWayProcedureEdit.html | 72 ------ .../erpWayProcedure/erpWayProcedureList.html | 58 ----- .../template/assets/lib/layui/custom.js | 3 + .../customer/tableUtil/initTableChooseUtil.js | 5 +- 14 files changed, 90 insertions(+), 981 deletions(-) delete mode 100644 erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureAdd.js delete mode 100644 erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureDetails.js delete mode 100644 erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureEdit.js delete mode 100644 erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureList.js delete mode 100644 erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureAdd.html delete mode 100644 erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureDetails.html delete mode 100644 erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureEdit.html delete mode 100644 erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureList.html diff --git a/erp-produce/src/main/resources/template/js/erpFarm/erpFarmChoose.js b/erp-produce/src/main/resources/template/js/erpFarm/erpFarmChoose.js index 5dae6d920..9aacc7f96 100644 --- a/erp-produce/src/main/resources/template/js/erpFarm/erpFarmChoose.js +++ b/erp-produce/src/main/resources/template/js/erpFarm/erpFarmChoose.js @@ -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,31 +69,53 @@ 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"); - dubClick.find("input[type='radio']").prop("checked", true); - form.render(); - var chooseIndex = JSON.stringify(dubClick.data('index')); - var obj = res.rows[chooseIndex]; - parent.farmMation = obj; - - parent.refreshCode = '0'; - parent.layer.close(index); + 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')); + var obj = res.rows[chooseIndex]; + parent.farmMation = 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"); - click.find("input[type='radio']").prop("checked", true); - form.render(); + 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', diff --git a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureAdd.js b/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureAdd.js deleted file mode 100644 index dfe877468..000000000 --- a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureAdd.js +++ /dev/null @@ -1,200 +0,0 @@ - -// 工序选择必备参数 -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 '' + - ''; - }}, - { 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 '' + - ''; - }} - ]], - 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 diff --git a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureChoose.js b/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureChoose.js index af8df43c5..b5c59a39c 100644 --- a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureChoose.js +++ b/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureChoose.js @@ -15,71 +15,68 @@ 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 '' + d.wayNumber + ''; - }}, - { 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"); - 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); - parent.refreshCode = '0'; + 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')); + 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"); - click.find("input[type='radio']").prop("checked", true); - form.render(); + 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(); }); - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); - } + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } - function getTableParams(){ - return { - wayNumber: $("#wayNumber").val(), - wayName: $("#wayName").val() - }; + function getTableParams() { + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); } exports('erpWayProcedureChoose', {}); diff --git a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureDetails.js b/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureDetails.js deleted file mode 100644 index 061edbd74..000000000 --- a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureDetails.js +++ /dev/null @@ -1,63 +0,0 @@ - -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 diff --git a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureEdit.js b/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureEdit.js deleted file mode 100644 index d45f3be14..000000000 --- a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureEdit.js +++ /dev/null @@ -1,218 +0,0 @@ - -// 工序选择必备参数 -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 '' + - ''; - }}, - { 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 '' + - ''; - }} - ]], - 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 diff --git a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureList.js b/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureList.js deleted file mode 100644 index f2537ac89..000000000 --- a/erp-produce/src/main/resources/template/js/erpWayProcedure/erpWayProcedureList.js +++ /dev/null @@ -1,172 +0,0 @@ - -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 '' + d.wayNumber + ''; - }}, - { field: 'wayName', title: '工艺名称', align: 'left', width: 250}, - { field: 'state', title: '状态', align: 'left', width: 80, templet: function (d) { - if(d.state == '1'){ - return "禁用"; - } else if (d.state == '2'){ - return "启用"; - } 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', {}); -}); diff --git a/erp-produce/src/main/resources/template/js/erpWorkProcedure/erpWorkProcedureChoose.js b/erp-produce/src/main/resources/template/js/erpWorkProcedure/erpWorkProcedureChoose.js index 507767a36..c4b722498 100644 --- a/erp-produce/src/main/resources/template/js/erpWorkProcedure/erpWorkProcedureChoose.js +++ b/erp-produce/src/main/resources/template/js/erpWorkProcedure/erpWorkProcedureChoose.js @@ -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); diff --git a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureAdd.html b/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureAdd.html deleted file mode 100644 index 17a05014e..000000000 --- a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureAdd.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - -
-
-
- 工艺信息
-
-
- -
- -
-
-
- -
- -
-
-
- 加工工序
-
-
- -
-
- 拖拽表格行可修改工序顺序。 -
-
- - -
- - -
-
-
- -
-
- - -
-
-
-
- - - - - - \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureChoose.html b/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureChoose.html index e06b4d3a2..9edd26e70 100644 --- a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureChoose.html +++ b/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureChoose.html @@ -7,29 +7,11 @@ -
-
-
-
- -
- -
- -
- -
- - -
-
-
+
+
+ +
-
-
- -
-
diff --git a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureDetails.html b/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureDetails.html deleted file mode 100644 index 7c933898f..000000000 --- a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureDetails.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - -
-
- -
-
- - - - - - - - \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureEdit.html b/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureEdit.html deleted file mode 100644 index 781a2abc7..000000000 --- a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureEdit.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - -
-
- -
-
- - - - - - - - \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureList.html b/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureList.html deleted file mode 100644 index e822c860e..000000000 --- a/erp-produce/src/main/resources/template/tpl/erpWayProcedure/erpWayProcedureList.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - -
-
-
-
- -
- -
- -
- -
- - -
-
-
-
-
-
- - -
-
-
-
- - -
- - - - - \ No newline at end of file diff --git a/web/src/main/resources/template/assets/lib/layui/custom.js b/web/src/main/resources/template/assets/lib/layui/custom.js index 57d128abb..8acae3f3f 100644 --- a/web/src/main/resources/template/assets/lib/layui/custom.js +++ b/web/src/main/resources/template/assets/lib/layui/custom.js @@ -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)){ diff --git a/web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableChooseUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableChooseUtil.js index db5e8dc4c..1f9d7d279 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableChooseUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableChooseUtil.js @@ -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]; - $("#" + tdId).val(value.name || value.title); + if (!isNull(value)) { + $("#" + tdId).val(value.name || value.title); + } } else if (formType == 'select') { if (!isNull(value["html"])) { $("#" + tdId).html(value["html"]); -- GitLab