From a22f303bc8cc310123dc79331647264bf9139bf1 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Wed, 20 Jul 2022 21:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ADM=E3=80=91=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E8=BF=81=E7=A7=BB=E5=88=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/assetManage/assetManageAdd.js | 19 +- .../js/assetManage/assetManageEdit.js | 20 +- .../assetManagePurchaseAdd.js | 21 +-- .../assetManagePurchaseEdit.js | 17 +- .../assetManageReturn/assetManageReturnAdd.js | 95 +++++----- .../assetManageReturnEdit.js | 92 +++++----- .../js/assetManageType/assetManageTypeAdd.js | 32 ---- .../js/assetManageType/assetManageTypeEdit.js | 44 ----- .../js/assetManageType/assetManageTypeList.js | 173 ------------------ .../js/assetManageUse/assetManageUseAdd.js | 96 +++++----- .../js/assetManageUse/assetManageUseEdit.js | 92 +++++----- .../assetManageType/assetManageTypeAdd.html | 32 ---- .../assetManageType/assetManageTypeEdit.html | 21 --- .../assetManageTypeEditTemplate.tpl | 14 -- .../assetManageType/assetManageTypeList.html | 74 -------- .../resources/template/json/sysDictData.json | 3 +- 16 files changed, 211 insertions(+), 634 deletions(-) delete mode 100644 admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeAdd.js delete mode 100644 admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeEdit.js delete mode 100644 admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeList.js delete mode 100644 admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeAdd.html delete mode 100644 admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEdit.html delete mode 100644 admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEditTemplate.tpl delete mode 100644 admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeList.html diff --git a/admin-assistant/src/main/resources/template/js/assetManage/assetManageAdd.js b/admin-assistant/src/main/resources/template/js/assetManage/assetManageAdd.js index 2f1d92c36..377bd38dd 100644 --- a/admin-assistant/src/main/resources/template/js/assetManage/assetManageAdd.js +++ b/admin-assistant/src/main/resources/template/js/assetManage/assetManageAdd.js @@ -23,21 +23,10 @@ layui.config({ // 采购日期 laydate.render({elem: '#purchaseTime', type: 'date', max: getYMDFormatDate(), trigger: 'click'}); - - //资产类型 - showGrid({ - id: "typeId", - url: flowableBasePath + "assettype006", - params: {}, - pagination: false, - template: getFileContent('tpl/template/select-option-must.tpl'), - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function (json) { - form.render('select'); - } - }); - + + // 资产类型 + sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], 'select', "typeId", '', form); + //资产来源 showGrid({ id: "fromId", diff --git a/admin-assistant/src/main/resources/template/js/assetManage/assetManageEdit.js b/admin-assistant/src/main/resources/template/js/assetManage/assetManageEdit.js index b5078aae9..14c1c1472 100644 --- a/admin-assistant/src/main/resources/template/js/assetManage/assetManageEdit.js +++ b/admin-assistant/src/main/resources/template/js/assetManage/assetManageEdit.js @@ -36,22 +36,10 @@ layui.config({ // 采购日期 laydate.render({elem: '#purchaseTime', type: 'date', max: getFormatDate(), trigger: 'click'}); - - // 资产类型 - showGrid({ - id: "typeId", - url: flowableBasePath + "assettype006", - params: {}, - pagination: false, - template: getFileContent('tpl/template/select-option-must.tpl'), - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - $("#typeId").val(json.bean.typeId); - form.render('select'); - } - }); - + + // 资产类型 + sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], 'select', "typeId", json.bean.typeId, form); + //资产来源 showGrid({ id: "fromId", diff --git a/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseAdd.js b/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseAdd.js index 8e85b68f1..330d5a258 100644 --- a/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseAdd.js +++ b/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseAdd.js @@ -25,23 +25,18 @@ layui.config({ $("#useName").html(data.bean.userName); }); - initTypeHtml(); - - //初始化资产类别 - function initTypeHtml() { - AjaxPostUtil.request({url: flowableBasePath + "assettype006", params: {}, type: 'json', callback: function(json) { - initFromHtml(); - typeHtml = getDataUseHandlebars(selOption, json); //加载类别数据 - //渲染 - form.render(); - addRow(); - }}); - } - //初始化资产来源 + // 资产类型 + sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], function (data) { + typeHtml = getDataUseHandlebars(selOption, data); + }); + + initFromHtml(); + // 初始化资产来源 function initFromHtml() { AjaxPostUtil.request({url: flowableBasePath + "assetfrom006", params: {}, type: 'json', async:false, callback: function(json) { fromHtml = getDataUseHandlebars(selOption, json); //加载资产来源数据 matchingLanguage(); + addRow(); form.render(); }}); } diff --git a/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseEdit.js b/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseEdit.js index 66feeb486..b469e4113 100644 --- a/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseEdit.js +++ b/admin-assistant/src/main/resources/template/js/assetManagePurchase/assetManagePurchaseEdit.js @@ -39,14 +39,14 @@ layui.config({ //初始化资产类别 function initTypeHtml() { - AjaxPostUtil.request({url: flowableBasePath + "assettype006", params: {}, type: 'json', callback: function(json) { - initFromHtml(); - typeHtml = getDataUseHandlebars(selOption, json); //加载类别数据 - //渲染 - form.render(); - //加载表格数据 - initTableAssetList(); - }}); + // 资产类型 + sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], function (data) { + typeHtml = getDataUseHandlebars(selOption, data); + }); + // 加载表格数据 + initTableAssetList(); + + initFromHtml(); } //初始化资产来源 @@ -101,7 +101,6 @@ layui.config({ var noError = false; //循环遍历表格数据时,是否有其他错误信息 $.each(rowTr, function(i, item) { var rowNum = $(item).attr("trcusid").replace("tr", ""); - var assetNum = parseInt($("#assetNum" + rowNum).html()); if(isNull($("#managementImg" + rowNum).find("input[type='hidden'][name='upload']").attr("oldurl"))){ winui.window.msg('资产图片不能为空!', {icon: 2, time: 2000}); noError = true; diff --git a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnAdd.js b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnAdd.js index fc47aed5b..a99a2ed5c 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnAdd.js +++ b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnAdd.js @@ -25,57 +25,56 @@ layui.config({ }); initTypeHtml(); - // 初始化资产类别 function initTypeHtml() { - AjaxPostUtil.request({url: flowableBasePath + "assettype006", params: {}, type: 'json', callback: function(json) { - typeHtml = getDataUseHandlebars(selOption, json); //加载类别数据 - // 渲染 - form.render(); - //类型加载变化事件 - form.on('select(selectTypeProperty)', function(data) { - var thisRowNum = data.elem.id.replace("typeId", ""); - var thisRowValue = data.value; - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - if(inPointArray(thisRowValue, assetList)) { - //类型对应的资产存在js对象中 - var list = getListPointArray(thisRowValue, assetList); - resetAssetList(thisRowNum, list); //重置选择行的资产列表 - } else { - //类型对应的资产不存在js对象中 - AjaxPostUtil.request({url: flowableBasePath + "asset026", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { - assetList.push({ - id: thisRowValue, - list: json.rows - }); - resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 - }}); - } - } - }); - - //商品加载变化事件 - form.on('select(selectAssetarProperty)', function(data) { - var thisRowNum = data.elem.id.replace("assetId", ""); - var thisRowValue = data.value; - var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - var list = getListPointArray(thisRowTypeChooseId, assetList); - $.each(list, function(i, item) { - if(item.id === thisRowValue) { - $("#specificationsName" + thisRowNum).html(item.specificationsName); - $("#assetNum" + thisRowNum).html(item.assetNum); - return false; - } - }); + // 资产类型 + sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], function (data) { + typeHtml = getDataUseHandlebars(selOption, data); + }); + form.render(); + //类型加载变化事件 + form.on('select(selectTypeProperty)', function(data) { + var thisRowNum = data.elem.id.replace("typeId", ""); + var thisRowValue = data.value; + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + if(inPointArray(thisRowValue, assetList)) { + //类型对应的资产存在js对象中 + var list = getListPointArray(thisRowValue, assetList); + resetAssetList(thisRowNum, list); //重置选择行的资产列表 } else { - $("#specificationsName" + thisRowNum).html(""); //重置规格为空 - $("#assetNum" + thisRowNum).html(""); //重置编号为空 + //类型对应的资产不存在js对象中 + AjaxPostUtil.request({url: flowableBasePath + "asset026", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { + assetList.push({ + id: thisRowValue, + list: json.rows + }); + resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 + }}); } - }); - //初始化一行数据 - addRow(); - matchingLanguage(); - }}); + } + }); + + //商品加载变化事件 + form.on('select(selectAssetarProperty)', function(data) { + var thisRowNum = data.elem.id.replace("assetId", ""); + var thisRowValue = data.value; + var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + var list = getListPointArray(thisRowTypeChooseId, assetList); + $.each(list, function(i, item) { + if(item.id === thisRowValue) { + $("#specificationsName" + thisRowNum).html(item.specificationsName); + $("#assetNum" + thisRowNum).html(item.assetNum); + return false; + } + }); + } else { + $("#specificationsName" + thisRowNum).html(""); //重置规格为空 + $("#assetNum" + thisRowNum).html(""); //重置编号为空 + } + }); + // 初始化一行数据 + addRow(); + matchingLanguage(); } skyeyeEnclosure.init('enclosureUpload'); diff --git a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnEdit.js b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnEdit.js index 347cade75..507683497 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnEdit.js +++ b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnEdit.js @@ -37,57 +37,55 @@ layui.config({ matchingLanguage(); }}); - //初始化资产类别 function initTypeHtml() { - AjaxPostUtil.request({url: flowableBasePath + "assettype006", params: {}, type: 'json', callback: function(json) { - typeHtml = getDataUseHandlebars(selOption, json); //加载类别数据 - //渲染 - form.render(); - //类型加载变化事件 - form.on('select(selectTypeProperty)', function(data) { - var thisRowNum = data.elem.id.replace("typeId", ""); - var thisRowValue = data.value; - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - if(inPointArray(thisRowValue, assetList)) { - //类型对应的资产存在js对象中 - var list = getListPointArray(thisRowValue, assetList); - resetAssetList(thisRowNum, list); //重置选择行的资产列表 - } else { - //类型对应的资产不存在js对象中 - AjaxPostUtil.request({url: flowableBasePath + "asset026", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { - assetList.push({ - id: thisRowValue, - list: json.rows - }); - resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 - }}); - } - } - }); - - //商品加载变化事件 - form.on('select(selectAssetarProperty)', function(data) { - var thisRowNum = data.elem.id.replace("assetId", ""); - var thisRowValue = data.value; - var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - var list = getListPointArray(thisRowTypeChooseId, assetList); - $.each(list, function(i, item) { - if(item.id === thisRowValue) { - $("#specificationsName" + thisRowNum).html(item.specificationsName); - $("#assetNum" + thisRowNum).html(item.assetNum); - return false; - } - }); + // 资产类型 + sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], function (data) { + typeHtml = getDataUseHandlebars(selOption, data); + }); + form.render(); + //类型加载变化事件 + form.on('select(selectTypeProperty)', function(data) { + var thisRowNum = data.elem.id.replace("typeId", ""); + var thisRowValue = data.value; + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + if(inPointArray(thisRowValue, assetList)) { + //类型对应的资产存在js对象中 + var list = getListPointArray(thisRowValue, assetList); + resetAssetList(thisRowNum, list); //重置选择行的资产列表 } else { - $("#specificationsName" + thisRowNum).html(""); //重置规格为空 - $("#assetNum" + thisRowNum).html(""); //重置库存为空 + //类型对应的资产不存在js对象中 + AjaxPostUtil.request({url: flowableBasePath + "asset026", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { + assetList.push({ + id: thisRowValue, + list: json.rows + }); + resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 + }}); } - }); - //加载表格数据 - initTableAssetList(); + } + }); - }}); + //商品加载变化事件 + form.on('select(selectAssetarProperty)', function(data) { + var thisRowNum = data.elem.id.replace("assetId", ""); + var thisRowValue = data.value; + var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + var list = getListPointArray(thisRowTypeChooseId, assetList); + $.each(list, function(i, item) { + if(item.id === thisRowValue) { + $("#specificationsName" + thisRowNum).html(item.specificationsName); + $("#assetNum" + thisRowNum).html(item.assetNum); + return false; + } + }); + } else { + $("#specificationsName" + thisRowNum).html(""); //重置规格为空 + $("#assetNum" + thisRowNum).html(""); //重置库存为空 + } + }); + //加载表格数据 + initTableAssetList(); } //加载表格数据 diff --git a/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeAdd.js b/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeAdd.js deleted file mode 100644 index 10089aa21..000000000 --- a/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeAdd.js +++ /dev/null @@ -1,32 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - - matchingLanguage(); - form.render(); - form.on('submit(formAddBean)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - typeName: $("#typeName").val() - }; - AjaxPostUtil.request({url: flowableBasePath + "assettype002", params: params, type: 'json', callback: function (json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - }); -}); \ No newline at end of file diff --git a/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeEdit.js b/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeEdit.js deleted file mode 100644 index 0987a5ebd..000000000 --- a/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeEdit.js +++ /dev/null @@ -1,44 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - - showGrid({ - id: "showForm", - url: flowableBasePath + "assettype004", - params: {rowId: parent.rowId}, - pagination: false, - template: getFileContent('tpl/assetManageType/assetManageTypeEditTemplate.tpl'), - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function (json) { - matchingLanguage(); - form.render(); - form.on('submit(formEditBean)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - rowId: parent.rowId, - typeName: $("#typeName").val() - }; - AjaxPostUtil.request({url: flowableBasePath + "assettype005", params: params, type: 'json', callback: function (json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - } - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - }); -}); \ No newline at end of file diff --git a/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeList.js b/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeList.js deleted file mode 100644 index 2c99c9604..000000000 --- a/admin-assistant/src/main/resources/template/js/assetManageType/assetManageTypeList.js +++ /dev/null @@ -1,173 +0,0 @@ -var rowId = ""; - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) { - - winui.renderColor(); - - var $ = layui.$, - form = layui.form, - table = layui.table; - - // 新增类别 - authBtn('1596981316446'); - - showAssettypeList(); - // 资产类型列表 - function showAssettypeList(){ - table.render({ - id: 'assettypeTable', - elem: '#assettypeTable', - method: 'post', - url: flowableBasePath + 'assettype001', - where: getTableParams(), - even: true, - page: true, - limits: getLimits(), - limit: getLimit(), - cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'}, - { field: 'typeName', title: '类型名称', width: 170 }, - { field: 'state', title: '状态', width: 100, align: 'center', templet: function (d) { - if(d.state == '0'){ - return "新建"; - }else if(d.state == '1'){ - return "线上"; - }else if(d.state == '2'){ - return "线下"; - } else { - return "参数错误"; - } - }}, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 250, toolbar: '#assettypetableBar'} - ]], - done: function(){ - matchingLanguage(); - } - }); - } - - table.on('tool(assettypeTable)', function (obj) { - var data = obj.data; - var layEvent = obj.event; - if (layEvent === 'assettypedelete'){ //删除 - assettypedelet(data); - }else if (layEvent === 'assettypeedit'){ //编辑 - assettypeedit(data); - }else if (layEvent === 'assettypeup'){ //上线 - assettypeup(data); - }else if (layEvent === 'assettypedown'){ //下线 - assettypedown(data); - }else if (layEvent === 'assettypetop'){ //上移 - assettypetopOne(data); - }else if (layEvent === 'assettypelower'){ //下移 - assettypelowerOne(data); - } - }); - - form.render(); - - // 删除 - function assettypedelet(data){ - layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){ - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "assettype003", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - }); - } - - // 新增 - $("body").on("click", "#assettypeaddBean", function() { - _openNewWindows({ - url: "../../tpl/assetManageType/assetManageTypeAdd.html", - title: "新增资产类型", - pageId: "assetManageTypeAdd", - area: ['60vw', '30vh'], - callBack: function(refreshCode){ - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - }); - - // 编辑 - function assettypeedit(data){ - rowId = data.id; - _openNewWindows({ - url: "../../tpl/assetManageType/assetManageTypeEdit.html", - title: "编辑资产类型", - pageId: "assetManageTypeEdit", - area: ['60vw', '30vh'], - callBack: function(refreshCode){ - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - } - - // 上线 - function assettypeup(data, obj){ - var msg = obj ? '确认将【' + obj.data.typeName + '】上线吗?' : '确认将选中数据上线吗?'; - layer.confirm(msg, { icon: 3, title: '上线操作' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "assettype007", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("上线成功", {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - }); - } - - // 下线 - function assettypedown(data, obj){ - var msg = obj ? '确认将【' + obj.data.typeName + '】下线吗?' : '确认将选中数据下线吗?'; - layer.confirm(msg, { icon: 3, title: '下线操作' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "assettype008", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("下线成功", {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - }); - } - - // 上移 - function assettypetopOne(data){ - AjaxPostUtil.request({url: flowableBasePath + "assettype009", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - } - - // 下移 - function assettypelowerOne(data){ - AjaxPostUtil.request({url: flowableBasePath + "assettype010", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadassettypeTable(); - }}); - } - - $("body").on("click", "#assettypereloadTable", function() { - loadassettypeTable(); - }); - - // 搜索表单 - $("body").on("click", "#assettypeSearch", function() { - table.reload("assettypeTable", {page: {curr: 1}, where: getTableParams()}); - }); - - function loadassettypeTable(){ - table.reload("assettypeTable", {where: getTableParams()}); - } - - function getTableParams(){ - return { - typeName:$("#typeName").val(), - typeState:$("#typeState").val() - }; - } - - exports('assetManageTypeList', {}); -}); diff --git a/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseAdd.js b/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseAdd.js index d9369621c..6d907d2b1 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseAdd.js +++ b/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseAdd.js @@ -24,57 +24,57 @@ layui.config({ }); initTypeHtml(); - //初始化资产类别 function initTypeHtml() { - AjaxPostUtil.request({url: flowableBasePath + "assettype006", params: {}, type: 'json', callback: function(json) { - typeHtml = getDataUseHandlebars(selOption, json); //加载类别数据 - matchingLanguage(); - //渲染 - form.render(); - //类型加载变化事件 - form.on('select(selectTypeProperty)', function(data) { - var thisRowNum = data.elem.id.replace("typeId", ""); - var thisRowValue = data.value; - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - if(inPointArray(thisRowValue, assetList)) { - //类型对应的资产存在js对象中 - var list = getListPointArray(thisRowValue, assetList); - resetAssetList(thisRowNum, list); //重置选择行的资产列表 - } else { - //类型对应的资产不存在js对象中 - AjaxPostUtil.request({url: flowableBasePath + "asset011", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { - assetList.push({ - id: thisRowValue, - list: json.rows - }); - resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 - }}); - } - } - }); - - //商品加载变化事件 - form.on('select(selectAssetarProperty)', function(data) { - var thisRowNum = data.elem.id.replace("assetId", ""); - var thisRowValue = data.value; - var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - var list = getListPointArray(thisRowTypeChooseId, assetList); - $.each(list, function(i, item) { - if(item.id === thisRowValue) { - $("#specificationsName" + thisRowNum).html(item.specificationsName); - $("#assetNum" + thisRowNum).html(item.assetNum); - return false; - } - }); + // 资产类型 + sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], function (data) { + typeHtml = getDataUseHandlebars(selOption, data); + }); + matchingLanguage(); + //渲染 + form.render(); + //类型加载变化事件 + form.on('select(selectTypeProperty)', function(data) { + var thisRowNum = data.elem.id.replace("typeId", ""); + var thisRowValue = data.value; + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + if(inPointArray(thisRowValue, assetList)) { + //类型对应的资产存在js对象中 + var list = getListPointArray(thisRowValue, assetList); + resetAssetList(thisRowNum, list); //重置选择行的资产列表 } else { - $("#specificationsName" + thisRowNum).html(""); //重置规格为空 - $("#assetNum" + thisRowNum).html(""); //重置编号为空 + //类型对应的资产不存在js对象中 + AjaxPostUtil.request({url: flowableBasePath + "asset011", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { + assetList.push({ + id: thisRowValue, + list: json.rows + }); + resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 + }}); } - }); - //初始化一行数据 - addRow(); - }}); + } + }); + + //商品加载变化事件 + form.on('select(selectAssetarProperty)', function(data) { + var thisRowNum = data.elem.id.replace("assetId", ""); + var thisRowValue = data.value; + var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + var list = getListPointArray(thisRowTypeChooseId, assetList); + $.each(list, function(i, item) { + if(item.id === thisRowValue) { + $("#specificationsName" + thisRowNum).html(item.specificationsName); + $("#assetNum" + thisRowNum).html(item.assetNum); + return false; + } + }); + } else { + $("#specificationsName" + thisRowNum).html(""); //重置规格为空 + $("#assetNum" + thisRowNum).html(""); //重置编号为空 + } + }); + //初始化一行数据 + addRow(); } skyeyeEnclosure.init('enclosureUpload'); diff --git a/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseEdit.js b/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseEdit.js index 769d8c454..2a2363c1e 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseEdit.js +++ b/admin-assistant/src/main/resources/template/js/assetManageUse/assetManageUseEdit.js @@ -36,57 +36,55 @@ layui.config({ matchingLanguage(); }}); - // 初始化资产类别 function initTypeHtml() { - AjaxPostUtil.request({url: flowableBasePath + "assettype006", params: {}, type: 'json', callback: function(json) { - typeHtml = getDataUseHandlebars(selOption, json); //加载类别数据 - //渲染 - form.render(); - //类型加载变化事件 - form.on('select(selectTypeProperty)', function(data) { - var thisRowNum = data.elem.id.replace("typeId", ""); - var thisRowValue = data.value; - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - if(inPointArray(thisRowValue, assetList)) { - //类型对应的资产存在js对象中 - var list = getListPointArray(thisRowValue, assetList); - resetAssetList(thisRowNum, list); //重置选择行的资产列表 - } else { - //类型对应的资产不存在js对象中 - AjaxPostUtil.request({url: flowableBasePath + "asset011", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { - assetList.push({ - id: thisRowValue, - list: json.rows - }); - resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 - }}); - } - } - }); - - //商品加载变化事件 - form.on('select(selectAssetarProperty)', function(data) { - var thisRowNum = data.elem.id.replace("assetId", ""); - var thisRowValue = data.value; - var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); - if(!isNull(thisRowValue) && thisRowValue != '请选择') { - var list = getListPointArray(thisRowTypeChooseId, assetList); - $.each(list, function(i, item) { - if(item.id === thisRowValue) { - $("#specificationsName" + thisRowNum).html(item.specificationsName); - $("#assetNum" + thisRowNum).html(item.assetNum); - return false; - } - }); + // 资产类型 + sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admAssetType"]["key"], function (data) { + typeHtml = getDataUseHandlebars(selOption, data); + }); + form.render(); + //类型加载变化事件 + form.on('select(selectTypeProperty)', function(data) { + var thisRowNum = data.elem.id.replace("typeId", ""); + var thisRowValue = data.value; + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + if(inPointArray(thisRowValue, assetList)) { + //类型对应的资产存在js对象中 + var list = getListPointArray(thisRowValue, assetList); + resetAssetList(thisRowNum, list); //重置选择行的资产列表 } else { - $("#specificationsName" + thisRowNum).html(""); //重置规格为空 - $("#assetNum" + thisRowNum).html(""); //重置库存为空 + //类型对应的资产不存在js对象中 + AjaxPostUtil.request({url: flowableBasePath + "asset011", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { + assetList.push({ + id: thisRowValue, + list: json.rows + }); + resetAssetList(thisRowNum, json.rows); //重置选择行的资产列表 + }}); } - }); - //加载表格数据 - initTableAssetList(); + } + }); - }}); + //商品加载变化事件 + form.on('select(selectAssetarProperty)', function(data) { + var thisRowNum = data.elem.id.replace("assetId", ""); + var thisRowValue = data.value; + var thisRowTypeChooseId = $("#typeId" + thisRowNum).val(); + if(!isNull(thisRowValue) && thisRowValue != '请选择') { + var list = getListPointArray(thisRowTypeChooseId, assetList); + $.each(list, function(i, item) { + if(item.id === thisRowValue) { + $("#specificationsName" + thisRowNum).html(item.specificationsName); + $("#assetNum" + thisRowNum).html(item.assetNum); + return false; + } + }); + } else { + $("#specificationsName" + thisRowNum).html(""); //重置规格为空 + $("#assetNum" + thisRowNum).html(""); //重置库存为空 + } + }); + // 加载表格数据 + initTableAssetList(); } //加载表格数据 diff --git a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeAdd.html b/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeAdd.html deleted file mode 100644 index 8f6212cc1..000000000 --- a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeAdd.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - -
-
-
- -
- -
-
-
-
- - -
-
-
-
- - - - - \ No newline at end of file diff --git a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEdit.html b/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEdit.html deleted file mode 100644 index 0f6cb4daf..000000000 --- a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEdit.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - -
-
- -
-
- - - - - \ No newline at end of file diff --git a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEditTemplate.tpl b/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEditTemplate.tpl deleted file mode 100644 index 52998a1d4..000000000 --- a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeEditTemplate.tpl +++ /dev/null @@ -1,14 +0,0 @@ -{{#bean}} -
- -
- -
-
-
-
- - -
-
-{{/bean}} \ No newline at end of file diff --git a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeList.html b/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeList.html deleted file mode 100644 index cb268e021..000000000 --- a/admin-assistant/src/main/resources/template/tpl/assetManageType/assetManageTypeList.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - -
-
-
-
-
- -
- -
- -
- -
- - -
-
-
-
-
-
- - -
-
-
-
- -
-
- - - - - \ No newline at end of file diff --git a/web/src/main/resources/template/json/sysDictData.json b/web/src/main/resources/template/json/sysDictData.json index a946bf576..9b799dc5f 100644 --- a/web/src/main/resources/template/json/sysDictData.json +++ b/web/src/main/resources/template/json/sysDictData.json @@ -32,6 +32,7 @@ "pmProjectDiscussType": {"name": "PM-项目讨论板分类", "key": "PM_PROJECT_DISCUSS_TYPE"}, "pmTaskType": {"name": "PM-任务分类", "key": "PM_TASK_TYPE"}, - "admAssetArticlesType": {"name": "ADM-用品类别", "key": "ADM_ASSET_ARTICLES_TYPE"} + "admAssetArticlesType": {"name": "ADM-用品类别", "key": "ADM_ASSET_ARTICLES_TYPE"}, + "admAssetType": {"name": "ADM-资产类型", "key": "ADM_ASSET_TYPE"} } -- GitLab