diff --git a/README.md b/README.md index 1fa716312ef1bf200cded9e207ebe7de5834d664..4a853fc3245e430af7a74ef68cddd8efaf30850a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ - [项目功能结构](https://docs.qq.com/flowchart/DYUFQQnlCUm9Ua2FI) - [企业版信息以及价格表](https://docs.qq.com/doc/DQlRxcVRMWWVjbU1i?_from=1&disableReturnList=1) - `企业版所有功能部署包`以及`设计思路`获取方式:扫码进入知识星球 -- **最低1.8W即可获得企业版所有源代码** - **五人团已凑齐三人,差两人开团** - 作者本人承诺,知识星球人数达到1000人,即开放所有功能模块源代码(仅供星球内部成员使用) diff --git a/admin-assistant/src/main/resources/template/js/assetArticlesPurchase/assetArticlesPurchaseList.js b/admin-assistant/src/main/resources/template/js/assetArticlesPurchase/assetArticlesPurchaseList.js index 36f26fe7d2f01898e72b92ea55ddce49325bc878..cba4cc12d5debec9490c40eee940148ab5665835 100644 --- a/admin-assistant/src/main/resources/template/js/assetArticlesPurchase/assetArticlesPurchaseList.js +++ b/admin-assistant/src/main/resources/template/js/assetArticlesPurchase/assetArticlesPurchaseList.js @@ -59,11 +59,11 @@ layui.config({ caigouEdit(data); } else if (layEvent === 'caigouSubApproval') { //采购提交审批 caigouSubApproval(data); - } else if (layEven === 'caigouCancellation') {//采购作废 + } else if (layEvent === 'caigouCancellation') {//采购作废 caigouCancellation(data); - } else if (layEven === 'caigouProcessDetails') {//采购流程详情 + } else if (layEvent === 'caigouProcessDetails') {//采购流程详情 activitiUtil.activitiDetails(data); - } else if (layEven === 'caigouRevoke') {//撤销采购申请 + } else if (layEvent === 'caigouRevoke') {//撤销采购申请 caigouRevoke(data); } }); 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 e26495c09fdb39ca87086e697c20832f8ba242dc..0955657fc27bf8c3ea3776db0e42a9ea9a04b350 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnAdd.js +++ b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnAdd.js @@ -1,6 +1,4 @@ -var assetList = new Array(); //资产集合 - // 资产归还 layui.config({ base: basePath, @@ -12,72 +10,40 @@ layui.config({ var index = parent.layer.getFrameIndex(window.name); var $ = layui.$, form = layui.form; - var rowNum = 1; //表格的序号 - var typeHtml = ""; - var returntableTemplate = $("#returntableTemplate").html(); - var selOption = getFileContent('tpl/template/select-option.tpl'); + var allChooseAssetReport = {}; // 获取当前登录员工信息 systemCommonUtil.getSysCurrentLoginUserMation(function (data) { $("#useTitle").html("资产归还申请单-" + getYMDFormatDate() + '-' + data.bean.userName); $("#useName").html(data.bean.userName); }); - initTypeHtml(); - function initTypeHtml() { - // 资产类型 - 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 { - //类型对应的资产不存在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); //重置选择行的资产列表 - }}); - } - } - }); + skyeyeEnclosure.init('enclosureUpload'); - //商品加载变化事件 - 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(); - } + // 资产 + initTableChooseUtil.initTable({ + id: "assetReportList", + cols: [ + {id: 'assetReportId', title: '资产', formType: 'chooseInput', width: '150', iconClassName: 'chooseMyUseAssetReportBtn', verify: 'required'}, + {id: 'specifications', title: '规格', formType: 'detail', width: '150'}, + {id: 'assetNum', title: '编号', formType: 'detail', width: '150'}, + {id: 'assetImg', title: '图片', formType: 'detail', width: '80'}, + {id: 'storageArea', title: '存放区域', formType: 'detail', width: '150'}, + {id: 'remark', title: '备注', formType: 'input', width: '100'} + ], + deleteRowCallback: function (trcusid) { + delete allChooseAssetReport[trcusid]; + }, + addRowCallback: function (trcusid) { + }, + form: form, + minData: 1 + }); + + matchingLanguage(); + form.render(); - skyeyeEnclosure.init('enclosureUpload'); // 保存为草稿 form.on('submit(formAddBean)', function(data) { if(winui.verifyForm(data.elem)) { @@ -97,29 +63,26 @@ layui.config({ }); function saveData(subType, approvalId) { - // 获取已选资产数据 - var rowTr = $("#returnTable tr"); - if(rowTr.length == 0) { - winui.window.msg('请选择需要归还的资产~', {icon: 2, time: 2000}); + var result = initTableChooseUtil.getDataList('assetReportList'); + if (!result.checkResult) { return false; } var tableData = new Array(); - var noError = false; //循环遍历表格数据时,是否有其他错误信息 - $.each(rowTr, function(i, item) { - var rowNum = $(item).attr("trcusid").replace("tr", ""); - if(inTableDataArrayByAssetarId($("#assetId" + rowNum).val(), tableData)){ - winui.window.msg('归还单存在相同的资产', {icon: 2, time: 2000}); + var noError = false; + $.each(result.dataList, function(i, item) { + // 获取行编号 + var thisRowKey = item["trcusid"].replace("tr", ""); + + var assetReport = allChooseAssetReport["tr" + thisRowKey]; + if (judgeInPoingArr(tableData, "assetReportId", assetReport.id)) { + winui.window.msg('领用单存在相同的资产', {icon: 2, time: 2000}); noError = true; return false; } - var row = { - typeId: $("#typeId" + rowNum).val(), - assetId: $("#assetId" + rowNum).val(), - remark: $("#remark" + rowNum).val() - }; - tableData.push(row); + item["assetReportId"] = assetReport.id; + tableData.push(item); }); - if(noError) { + if (noError) { return false; } @@ -137,94 +100,26 @@ layui.config({ }}); } - //判断选中的资产是否也在数组中 - function inTableDataArrayByAssetarId(str, array) { - var isIn = false; - $.each(array, function(i, item) { - if(item.assetId === str) { - isIn = true; - return false; - } + $("body").on("click", ".chooseMyUseAssetReportBtn", function() { + var trId = $(this).parent().parent().attr("trcusid"); + adminAssistantUtil.myUseAssetReportCheckType = false; // 选择类型,默认单选,true:多选,false:单选 + adminAssistantUtil.openMyUseAssetReportChoosePage(function (checkMyUseAssetReportMation) { + // 获取表格行号 + var thisRowKey = trId.replace("tr", ""); + $("#assetReportId" + thisRowKey.toString()).val(checkMyUseAssetReportMation.assetName); + $("#specifications" + thisRowKey.toString()).html(checkMyUseAssetReportMation.specifications); + $("#assetNum" + thisRowKey.toString()).html(checkMyUseAssetReportMation.assetNum); + $("#assetImg" + thisRowKey.toString()).html(''); + $("#storageArea" + thisRowKey.toString()).html(checkMyUseAssetReportMation.storageArea); + allChooseAssetReport[trId] = checkMyUseAssetReportMation; }); - return isIn; - } - - //新增行 - $("body").on("click", "#addRow", function() { - addRow(); }); - //删除行 - $("body").on("click", "#deleteRow", function() { - deleteRow(); + // 图片查看 + $("body").on("click", ".photo-img", function() { + systemCommonUtil.showPicImg($(this).attr("src")); }); - //新增行 - function addRow() { - var par = { - id: "row" + rowNum.toString(), //checkbox的id - trId: "tr" + rowNum.toString(), //行的id - typeId: "typeId" + rowNum.toString(), //类型id - assetId: "assetId" + rowNum.toString(), //资产id - specificationsName: "specificationsName" + rowNum.toString(), //规格id - assetNum: "assetNum" + rowNum.toString(), //库存id - remark: "remark" + rowNum.toString() //备注id - }; - $("#returnTable").append(getDataUseHandlebars(returntableTemplate, par)); - //赋值给资产类别 - $("#" + "typeId" + rowNum.toString()).html(typeHtml); - form.render('select'); - form.render('checkbox'); - rowNum++; - } - - //删除行 - function deleteRow() { - var checkRow = $("#returnTable input[type='checkbox'][name='tableCheckRow']:checked"); - if(checkRow.length > 0) { - $.each(checkRow, function(i, item) { - $(item).parent().parent().remove(); - }); - } else { - winui.window.msg('请选择要删除的行', {icon: 2, time: 2000}); - } - } - - //根据类型重置资产列表 - function resetAssetList(thisRowNum, list) { - var sHtml = getDataUseHandlebars(selOption, { - rows: list - }); - $("#assetId" + thisRowNum).html(sHtml); //重置商品列表下拉框 - $("#specificationsName" + thisRowNum).html(""); //重置规格为空 - $("#assetNum" + thisRowNum).html(""); //重置编号为空 - form.render('select'); - } - - //判断是否在数组中 - function inPointArray(str, array) { - var isIn = false; - $.each(array, function(i, item) { - if(item.id === str) { - isIn = true; - return false; - } - }); - return isIn; - } - - //获取指定key对应的集合 - function getListPointArray(str, array) { - var isList = []; - $.each(array, function(i, item) { - if(item.id === str) { - $.extend(true, isList, item.list); - return false; - } - }); - return isList; - } - $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnDetails.js b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnDetails.js index a67de10c69682901bd9793f1a31237eae1429353..3b13bf36c6499aeab684fcba9ebcbdadda2d9d21 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnDetails.js +++ b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnDetails.js @@ -20,5 +20,10 @@ layui.config({ matchingLanguage(); }}); + // 图片查看 + $("body").on("click", ".photo-img", function() { + systemCommonUtil.showPicImg($(this).attr("src")); + }); + }); }); \ No newline at end of file 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 c92709f8c62e46d919fe6d2b1cdfc48816c2f9b1..a364cad7bb15be7b8a3d23888b4d44775493e445 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnEdit.js +++ b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnEdit.js @@ -1,6 +1,4 @@ -var assetList = new Array(); //资产集合 - // 资产归还 layui.config({ base: basePath, @@ -12,13 +10,8 @@ layui.config({ var index = parent.layer.getFrameIndex(window.name); var $ = layui.$, form = layui.form; - var rowNum = 1; //表格的序号 - var typeHtml = ""; - - var usetableTemplate = $("#usetableTemplate").html(); - var selOption = getFileContent('tpl/template/select-option.tpl'); - var sTableData = ""; + var allChooseAssetReport = {}; AjaxPostUtil.request({url: flowableBasePath + "asset031", params: {rowId: parent.rowId}, type: 'json', callback: function(json) { $("#useTitle").html(json.bean.title); @@ -32,61 +25,44 @@ layui.config({ } else { $(".typeOne").removeClass("layui-hide"); } - sTableData = json.bean.goods; - initTypeHtml(); - matchingLanguage(); - }}); - function initTypeHtml() { - // 资产类型 - 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 { - //类型对应的资产不存在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); //重置选择行的资产列表 - }}); - } - } + // 资产 + initTableChooseUtil.initTable({ + id: "assetReportList", + cols: [ + {id: 'assetReportId', title: '资产', formType: 'chooseInput', width: '150', iconClassName: 'chooseMyUseAssetReportBtn', verify: 'required'}, + {id: 'specifications', title: '规格', formType: 'detail', width: '150'}, + {id: 'assetNum', title: '编号', formType: 'detail', width: '150'}, + {id: 'assetImg', title: '图片', formType: 'detail', width: '80'}, + {id: 'storageArea', title: '存放区域', formType: 'detail', width: '150'}, + {id: 'remark', title: '备注', formType: 'input', width: '100'} + ], + deleteRowCallback: function (trcusid) { + delete allChooseAssetReport[trcusid]; + }, + addRowCallback: function (trcusid) { + }, + form: form, + minData: 1 }); - //商品加载变化事件 - 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(""); //重置库存为空 - } + initTableChooseUtil.deleteAllRow('assetReportList'); + $.each(json.bean.goods, function(i, item) { + var params = { + "assetReportId": item.assetName, + "specifications": item.specifications, + "assetNum": item.assetNum, + "assetImg": '', + "storageArea": item.storageArea, + "remark": item.remark + }; + var trcusid = initTableChooseUtil.resetData('assetReportList', params); + item["id"] = item.assetReportId; + allChooseAssetReport[trcusid] = item; }); - //加载表格数据 - initTableAssetList(); - } + + matchingLanguage(); + }}); //加载表格数据 function initTableAssetList() { @@ -122,29 +98,26 @@ layui.config({ }); function saveData(subType, approvalId) { - // 获取已选资产数据 - var rowTr = $("#useTable tr"); - if(rowTr.length == 0) { - winui.window.msg('请选择需要归还的资产~', {icon: 2, time: 2000}); + var result = initTableChooseUtil.getDataList('assetReportList'); + if (!result.checkResult) { return false; } var tableData = new Array(); - var noError = false; //循环遍历表格数据时,是否有其他错误信息 - $.each(rowTr, function(i, item) { - var rowNum = $(item).attr("trcusid").replace("tr", ""); - var assetNum = parseInt($("#assetNum" + rowNum).html()); - if(inTableDataArrayByAssetarId($("#assetId" + rowNum).val(), tableData)){ - winui.window.msg('归还单存在相同的资产', {icon: 2, time: 2000}); + var noError = false; + $.each(result.dataList, function(i, item) { + // 获取行编号 + var thisRowKey = item["trcusid"].replace("tr", ""); + + var assetReport = allChooseAssetReport["tr" + thisRowKey]; + if (judgeInPoingArr(tableData, "assetReportId", assetReport.id)) { + winui.window.msg('领用单存在相同的资产', {icon: 2, time: 2000}); noError = true; return false; } - var row = { - assetReportId: $("#assetId" + rowNum).val(), - remark: $("#remark" + rowNum).val() - }; - tableData.push(row); + item["assetReportId"] = assetReport.id; + tableData.push(item); }); - if(noError) { + if (noError) { return false; } @@ -162,147 +135,26 @@ layui.config({ }}); } - //判断选中的资产是否也在数组中 - function inTableDataArrayByAssetarId(str, array) { - var isIn = false; - $.each(array, function(i, item) { - if(item.assetId === str) { - isIn = true; - return false; - } + $("body").on("click", ".chooseMyUseAssetReportBtn", function() { + var trId = $(this).parent().parent().attr("trcusid"); + adminAssistantUtil.myUseAssetReportCheckType = false; // 选择类型,默认单选,true:多选,false:单选 + adminAssistantUtil.openMyUseAssetReportChoosePage(function (checkMyUseAssetReportMation) { + // 获取表格行号 + var thisRowKey = trId.replace("tr", ""); + $("#assetReportId" + thisRowKey.toString()).val(checkMyUseAssetReportMation.assetName); + $("#specifications" + thisRowKey.toString()).html(checkMyUseAssetReportMation.specifications); + $("#assetNum" + thisRowKey.toString()).html(checkMyUseAssetReportMation.assetNum); + $("#assetImg" + thisRowKey.toString()).html(''); + $("#storageArea" + thisRowKey.toString()).html(checkMyUseAssetReportMation.storageArea); + allChooseAssetReport[trId] = checkMyUseAssetReportMation; }); - return isIn; - } - - //新增行 - $("body").on("click", "#addRow", function() { - addRow(); }); - //删除行 - $("body").on("click", "#deleteRow", function() { - deleteRow(); + // 图片查看 + $("body").on("click", ".photo-img", function() { + systemCommonUtil.showPicImg($(this).attr("src")); }); - //加载数据行 - function addDataRow(item) { - var thisRowNum = rowNum.toString(); - var par = { - id: "row" + thisRowNum, //checkbox的id - trId: "tr" + thisRowNum, //行的id - typeId: "typeId" + thisRowNum, //类型id - assetId: "assetId" + thisRowNum, //资产id - specificationsName: "specificationsName" + thisRowNum, //规格id - assetNum: "assetNum" + thisRowNum, //编号 - remark: "remark" + thisRowNum //备注id - }; - $("#useTable").append(getDataUseHandlebars(usetableTemplate, par)); - - //赋值给资产类别 - $("#" + "typeId" + thisRowNum).html(typeHtml); - - //数据回显 - $("#typeId" + thisRowNum).val(item.typeId); - $("#specificationsName" + thisRowNum).html(item.specificationsName); - $("#remark" + thisRowNum).val(item.remark); - $("#assetNum" + thisRowNum).html(item.assetNum); - var thisRowValue = item.typeId; - if (!isNull(thisRowValue) && thisRowValue != '请选择') { - if(inPointArray(thisRowValue, assetList)) { - //类型对应的资产存在js对象中 - var list = getListPointArray(thisRowValue, assetList); - //重置选择行的资产列表 - var sHtml = getDataUseHandlebars(selOption, {rows: list}); - $("#assetId" + thisRowNum).html(sHtml); //重置商品列表下拉框 - $("#assetId" + thisRowNum).val(item.assetId); - form.render('select'); - } else { - //类型对应的资产不存在js对象中 - AjaxPostUtil.request({url: flowableBasePath + "asset026", params: {typeId: thisRowValue}, type: 'json', callback: function(json) { - assetList.push({ - id: thisRowValue, - list: json.rows - }); - //重置选择行的资产列表 - var sHtml = getDataUseHandlebars(selOption, json); - $("#assetId" + thisRowNum).html(sHtml); //重置商品列表下拉框 - $("#assetId" + thisRowNum).val(item.assetId); - form.render('select'); - }, async: false}); - } - } - - form.render('select'); - form.render('checkbox'); - rowNum++; - } - - //新增行 - function addRow() { - var par = { - id: "row" + rowNum.toString(), //checkbox的id - trId: "tr" + rowNum.toString(), //行的id - typeId: "typeId" + rowNum.toString(), //类型id - assetId: "assetId" + rowNum.toString(), //资产id - specificationsName: "specificationsName" + rowNum.toString(), //规格id - assetNum: "assetNum" + rowNum.toString(), //编号 - remark: "remark" + rowNum.toString() //备注id - }; - $("#useTable").append(getDataUseHandlebars(usetableTemplate, par)); - //赋值给资产类别 - $("#" + "typeId" + rowNum.toString()).html(typeHtml); - form.render('select'); - form.render('checkbox'); - rowNum++; - } - - //删除行 - function deleteRow() { - var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']:checked"); - if(checkRow.length > 0) { - $.each(checkRow, function(i, item) { - $(item).parent().parent().remove(); - }); - } else { - winui.window.msg('请选择要删除的行', {icon: 2, time: 2000}); - } - } - - //根据类型重置用户列表 - function resetAssetList(thisRowNum, list) { - var sHtml = getDataUseHandlebars(selOption, { - rows: list - }); - $("#assetId" + thisRowNum).html(sHtml); //重置商品列表下拉框 - $("#specificationsName" + thisRowNum).html(""); //重置规格为空 - $("#assetNum" + thisRowNum).html(""); //重置库存为空 - form.render('select'); - } - - //判断是否在数组中 - function inPointArray(str, array) { - var isIn = false; - $.each(array, function(i, item) { - if(item.id === str) { - isIn = true; - return false; - } - }); - return isIn; - } - - //获取指定key对应的集合 - function getListPointArray(str, array) { - var isList = []; - $.each(array, function(i, item) { - if(item.id === str) { - $.extend(true, isList, item.list); - return false; - } - }); - return isList; - } - $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnList.js b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnList.js index bd69277a158b763d6f35460eec942d0f77d65821..323ae8112e6a9ec346bc2efa82b93f999dd968b5 100644 --- a/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnList.js +++ b/admin-assistant/src/main/resources/template/js/assetManageReturn/assetManageReturnList.js @@ -62,11 +62,11 @@ layui.config({ returnEdit(data); } else if (layEvent === 'returnSubApproval') { //归还提交审批 returnSubApproval(data); - } else if (layEven === 'returnCancellation') {//归还作废 + } else if (layEvent === 'returnCancellation') {//归还作废 returnCancellation(data); - } else if (layEven === 'returnProcessDetails') {//归还流程详情 + } else if (layEvent === 'returnProcessDetails') {//归还流程详情 activitiUtil.activitiDetails(data); - } else if (layEven === 'returnRevoke') {//撤销归还申请 + } else if (layEvent === 'returnRevoke') {//撤销归还申请 returnRevoke(data); } }); diff --git a/admin-assistant/src/main/resources/template/js/assetReportManage/assetReportMyUseChoose.js b/admin-assistant/src/main/resources/template/js/assetReportManage/assetReportMyUseChoose.js new file mode 100644 index 0000000000000000000000000000000000000000..f05cc16399f147e3a61fea435e394357e2765391 --- /dev/null +++ b/admin-assistant/src/main/resources/template/js/assetReportManage/assetReportMyUseChoose.js @@ -0,0 +1,141 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form', 'tableCheckBoxUtil'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + form = layui.form, + table = layui.table, + tableCheckBoxUtil = layui.tableCheckBoxUtil; + + // 选择类型,默认单选,true:多选,false:单选 + var myUseAssetReportCheckType = isNull(parent.adminAssistantUtil.myUseAssetReportCheckType) ? false : parent.adminAssistantUtil.myUseAssetReportCheckType; + + // 设置提示信息 + var s = '我已申领资产选择规则:1.已审批通过的资产'; + if(myUseAssetReportCheckType){ + s += '2.多选;'; + // 多选保存的资产对象信息 + var checkMyUseAssetReportMation = [].concat(parent.adminAssistantUtil.checkMyUseAssetReportMation); + // 初始化值 + var ids = []; + $.each(checkMyUseAssetReportMation, function(i, item) { + ids.push(item.id); + }); + tableCheckBoxUtil.setIds({ + gridId: 'messageTable', + fieldName: 'id', + ids: ids + }); + tableCheckBoxUtil.init({ + gridId: 'messageTable', + filterId: 'messageTable', + fieldName: 'id' + }); + } else { + s += '如没有查到要选择的资产信息,请检查资产信息是否满足当前规则。双击要选择的数据即可选中'; + $("#saveCheckBox").hide(); + } + $("#showInfo").html(s); + + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: flowableBasePath + 'myhasmation001', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { type: myUseAssetReportCheckType ? 'checkbox' : 'radio', rowspan: '3', fixed: 'left' }, + { title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '3', fixed: 'left', type: 'numbers' }, + { field: 'assetName', title: '资产名称', align: 'left', width: 120 }, + { field: 'assetImg', title: '图片', align: 'center', width: 60, templet: function (d) { + return ''; + }}, + { field: 'typeName', title: '类型', align: 'left', width: 100 }, + { field: 'assetNum', title: '资产编号', align: 'left', width: 150 }, + { field: 'specifications', title: '资产规格', align: 'left', width: 120 }, + { field: 'assetAdmin', title: '管理员', align: 'left', width: 120 }, + { field: 'createTime', title: '申领时间', align: 'center', width: 150 }, + ]], + done: function(res) { + matchingLanguage(); + + initTableSearchUtil.initAdvancedSearch(this, res.searchFilter, form, "请输入资产名称,资产编号", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); + if (myUseAssetReportCheckType) { + // 设置选中 + tableCheckBoxUtil.checkedDefault({ + gridId: 'messageTable', + fieldName: 'id' + }); + } else { + $('#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.adminAssistantUtil.checkMyUseAssetReportMation = 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(); + }); + } + } + }); + + table.on('tool(messageTable)', function (obj) { + var data = obj.data; + var layEvent = obj.event; + if (layEvent === 'assetImg') { // 图片预览 + systemCommonUtil.showPicImg(systemCommonUtil.getFilePath(data.assetImg)); + } + }); + + // 保存 + $("body").on("click", "#saveCheckBox", function() { + var selectedData = tableCheckBoxUtil.getValue({ + gridId: 'messageTable' + }); + if (selectedData.length == 0) { + winui.window.msg("请选择资产", {icon: 2, time: 2000}); + return false; + } + AjaxPostUtil.request({url: flowableBasePath + "queryAssetReportListByIds", params: {ids: selectedData.toString()}, type: 'json', method: "POST", callback: function (json) { + parent.adminAssistantUtil.checkMyUseAssetReportMation = [].concat(json.rows); + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + }); + + form.render(); + + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); + + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } + + function getTableParams() { + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); + } + + exports('assetReportUnUseChoose', {}); +}); \ No newline at end of file diff --git a/admin-assistant/src/main/resources/template/js/licenceManageRevert/licenceManageRevertList.js b/admin-assistant/src/main/resources/template/js/licenceManageRevert/licenceManageRevertList.js index 9ca7417926f5c63086a4ea6087fa4710cf341a2d..23e1e4d0e6d85bfd13b36628d86351b3e1b084aa 100644 --- a/admin-assistant/src/main/resources/template/js/licenceManageRevert/licenceManageRevertList.js +++ b/admin-assistant/src/main/resources/template/js/licenceManageRevert/licenceManageRevertList.js @@ -65,9 +65,9 @@ layui.config({ revertEdit(data); } else if (layEvent === 'revertsubapproval') { //提交审批 revertSubApproval(data); - } else if (layEven === 'revertcancellation') {//归还作废 + } else if (layEvent === 'revertcancellation') {//归还作废 revertCancellation(data); - } else if (layEven === 'revertrevoke') {//撤销 + } else if (layEvent === 'revertrevoke') {//撤销 revertrevoke(data); } }); diff --git a/admin-assistant/src/main/resources/template/js/myHasMation/myAssetManagement.js b/admin-assistant/src/main/resources/template/js/myHasMation/myAssetManagement.js index 13cbd9f692342f5ceadf9d701572d37ad0dfff61..a2919e5721dafe941c46c182921a23ecf59f9ed6 100644 --- a/admin-assistant/src/main/resources/template/js/myHasMation/myAssetManagement.js +++ b/admin-assistant/src/main/resources/template/js/myHasMation/myAssetManagement.js @@ -1,6 +1,4 @@ -var rowId = ""; - layui.config({ base: basePath, version: skyeyeVersion @@ -37,6 +35,9 @@ layui.config({ ]], done: function(json) { matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入资产名称,资产编号", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); } }); @@ -48,31 +49,17 @@ layui.config({ } }); - $("body").on("click", "#reloadmessageTable", function() { + form.render(); + $("body").on("click", "#reloadmessageTable", function() { loadTable(); }); - form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - refreshTable(); - } - return false; - }); function loadTable() { table.reloadData("messageTable", {where: getTableParams()}); } - function refreshTable(){ - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); - } - function getTableParams() { - return { - assetName: $("#assetName").val(), - assetNum: $("#assetNum").val(), - specifications: $("#specifications").val() - }; + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); } exports('myAssetManagement', {}); diff --git a/admin-assistant/src/main/resources/template/js/sealManageRevert/sealManageRevertList.js b/admin-assistant/src/main/resources/template/js/sealManageRevert/sealManageRevertList.js index ea998e3645d93fffb321064a0cd0f94c3c82070c..be30feb3c8f6e9492adabfce419753552d41174c 100644 --- a/admin-assistant/src/main/resources/template/js/sealManageRevert/sealManageRevertList.js +++ b/admin-assistant/src/main/resources/template/js/sealManageRevert/sealManageRevertList.js @@ -65,9 +65,9 @@ layui.config({ revertEdit(data); } else if (layEvent === 'revertsubapproval') { //提交审批 revertSubApproval(data); - } else if (layEven === 'revertcancellation') {//归还作废 + } else if (layEvent === 'revertcancellation') {//归还作废 revertCancellation(data); - } else if (layEven === 'revertrevoke') {//撤销 + } else if (layEvent === 'revertrevoke') {//撤销 revertrevoke(data); } }); diff --git a/admin-assistant/src/main/resources/template/tpl/assetManageReturn/assetManageReturnAdd.html b/admin-assistant/src/main/resources/template/tpl/assetManageReturn/assetManageReturnAdd.html index 0f39f771e6f51479187886b372bf05b247fedf93..b663d71ca65b32aee60808f5349c140a1bf53519 100644 --- a/admin-assistant/src/main/resources/template/tpl/assetManageReturn/assetManageReturnAdd.html +++ b/admin-assistant/src/main/resources/template/tpl/assetManageReturn/assetManageReturnAdd.html @@ -29,28 +29,9 @@
- | 资产类别* | -资产名称* | -规格 | -编号 | -备注 | -
---|