提交 5b478b82 编写于 作者: L LAPTOP-NDCM9L6Q\王丽雅

Merge branch 'company_server' of https://gitee.com/doc_wei01/skyeye into company_server

......@@ -16,8 +16,8 @@ layui.config({
var assetReportCheckType = isNull(parent.adminAssistantUtil.assetReportCheckType) ? false : parent.adminAssistantUtil.assetReportCheckType;
// 设置提示信息
var s = '资产明细选择规则:';
if(assetReportCheckType){
var s = '资产明细选择规则:仅加载未领用的资产信息。<br>';
if (assetReportCheckType) {
s += '1.多选;如没有查到要选择的资产信息,请检查资产信息是否满足当前规则。';
var ids = [];
$.each(parent.adminAssistantUtil.checkAssetReportMation, function(i, item) {
......
// 以下两个参数开启团队权限时有值
var objectId = '', objectKey = '';
// 根据以下两个参数判断:工作流的判断是否要根据serviceClassName的判断
var serviceClassName;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
var id = GetUrlParam("id");
// 资产采购订单转资产采购入库
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryDepotLevelValById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
let data = json.bean;
// 仓库级别的值的【编辑布局】
dsFormUtil.initEditPageForStatic('content', 'FP2024071200008', data, {
savePreParams: function (params) {
params.parentId=data.parentId
params.depotId=data.depotId
},
saveData: function (params) {
// 保存数据
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "writeDepotLevelVal", params: params, type: 'json', method: "POST", callback: function(json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
},
// loadComponentCallback: function () {
// // $("div[controlType='assetPurchasePutFromType']").remove();
// },
tableAddRowCallback: function (tableId) {
$("#addRow" + tableId).remove();
// $("div[controlType='simpleTable']").find(".assetId").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".fromId").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".unitPrice").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".chooseAssetBtn").prop('disabled', true);
}
});
}});
});
\ No newline at end of file
var folderId = "2";//当前所在目录的位置
var operaterId = "";//即将进行删除,重命名等操作的id
var folderTemplate;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'dropdown', 'fsCommon', 'fsTree', 'viewer', 'contextMenu', 'ClipboardJS', 'colorpicker', 'jqueryUI', 'webuploader','tableTreeDj'], function (exports) {
}).define(['window', 'jquery', 'winui', 'dropdown', 'fsCommon', 'fsTree', 'table', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
fsTree = layui.fsTree,
fsCommon = layui.fsCommon,
colorpicker = layui.colorpicker,
device = layui.device(),
tableTree = layui.tableTreeDj;
var currentUserId = "";
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data) {
currentUserId = data.bean.id;
});
//遮罩层显示
$(".fileconsole-mask").show();
matchingLanguage();
form = layui.form,
table = layui.table;
var ztree;
//下拉按钮
// 下拉按钮
var dropdown = new Dropdown();
dropdown.render();
var ztree = null;
//获取所有仓库queryAllStoreHouseList queryDepotLevelValList
/********* tree 处理 start *************/
fsTree.render({
id: "treeDemo",
url: sysMainMation.diskCloudBasePath + "fileconsole001",
url: sysMainMation.erpBasePath + "queryDepotLevelById",
checkEnable: false,
loadEnable: true,//异步加载
showLine: false,
showIcon: true,
addDiyDom: addDiyDom,
clickCallback: zTreeOnClick,
addDiyDom: ztreeUtil.addDiyDom,
clickCallback: onClickTree,
onRightClick: onRightClick,
onDblClick: function(){},
onAsyncSuccess: function(id){}
}, function(id){
onDblClick: function() {},
onAsyncSuccess: function(id) {}
}, function(id) {
ztree = $.fn.zTree.getZTreeObj(id);
loadThisFolderChild();
fuzzySearch(id, '#name', null, true);
initLoadTable();
ztreeUtil.initEventListener(id);
});
function addDiyDom(treeId, treeNode) {
// css样式以及位置调整
var spaceWidth = 8;
var switchObj = $("#" + treeNode.tId + "_switch"),
icoObj = $("#" + treeNode.tId + "_ico");
switchObj.remove();
icoObj.before(switchObj);
if (treeNode.level >= 1) {
var spaceStr = "<span style='display: inline-block;width:" + (spaceWidth * treeNode.level) + "px'></span>";
switchObj.before(spaceStr);
//异步加载的方法
function onClickTree(event, treeId, treeNode) {
if(treeNode == undefined) {
dictTypeId = "";
} else {
dictTypeId = treeNode.id;
}
loadTable();
}
function initLoadTable() {
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: sysMainMation.erpBasePath + 'queryDepotLevelValList',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '2', type: 'numbers' },
// { field: 'name', title: '名称', rowspan: '2', align: 'left', width: 300, templet: function (d) {
// return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
// }},
{ field: 'number', title: '编号', rowspan: '2', align: 'left', width: 350 },
// { field: 'warehousing', title: '仓储费', rowspan: '2', align: 'left', width: 150 },
// { field: 'truckage', title: '搬运费', rowspan: '2', align: 'left', width: 150 },
// // { field: 'isDefault', title: '是否默认', rowspan: '2', align: 'left', width: 100 },
// { field: 'isDefault', title: '是否默认', width: 100, align: "center", templet: function (d) {
// // return shopUtil.getMealOrderWhetherGiveName(d);
// return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("commonIsDefault", 'id', d.isDefault, 'name');
// }},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], rowspan: '2', align: 'left', width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], rowspan: '2', align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], rowspan: '2', align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], rowspan: '2', align: 'center', width: 150 },
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
} else if (layEvent === 'details'){ //详情
details(data);
} else if (layEvent === 'del') { //删除
del(data);
}
});
}
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2024071200007', null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "warehouseLevelValueAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
// 编辑
function edit(data) {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2024071200008&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "warehouseLevelValueEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 操作数据
var aObj = $("#" + treeNode.tId + "_a");
if ($("#diyBtn_" + treeNode.id).length > 0) return;
aObj.after("");
aObj.addClass("tree_a");
aObj.attr("ztreerowid", treeNode.id);
// 详情
function details(data) {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2024071200009&id=' + data.id, null),
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "warehouseLevelValueDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 删除
function del(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.admBasePath + "deleteDepotLevelValById", params: {id: data.id}, type: 'json', method: "DELETE", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 树节点右键
function onRightClick(event, treeId, treeNode) {
folderId = treeNode.id;
......@@ -80,9 +156,7 @@ layui.config({
name: treeNode.name
};
$("#treeRight").html(getDataUseHandlebars($("#treeRightTemplate").html(), {bean: par}));
{
showRMenu('root', event.clientX, event.clientY);
}
showRMenu('root', event.clientX, event.clientY);
}
// 展示树节点右键菜单
......@@ -110,238 +184,61 @@ layui.config({
}
}
// 刷新树指定节点
function refreshTreePointNode(){
// 刷新节点
var nownode = ztree.getNodesByParam("id", folderId, null);
ztree.reAsyncChildNodes(nownode[0], "refresh");
}
// 树的动画效果
$("body").on("mouseover", "#treeDemo a", function (e) {
$("#treeDemo").find("a").removeClass('mouseOver');
$(this).addClass('mouseOver');
});
$("body").on("mouseleave", "#treeDemo", function (e) {
$("#treeDemo").find("a").removeClass('mouseOver');
});
// 设置选中节点
function chooseNodeSelect(nodeId){
var selNode = ztree.getNodeByParam("id", nodeId, null);
ztree.selectNode(selNode);
}
// 右侧内容右键操作
$("body").on("contextmenu", "#file-content .file", function (e) {
var _this = $(this);
operaterId = _this.attr("rowid");
// 1.加载右侧右键内容
initFileContentRight(_this, e);
// 2.加载选中
setChooseFileContent(_this);
});
// 加载右侧右键内容
function initFileContentRight(_this, e) {
var par = {
id: _this.attr("rowid"),
name: _this.find(".title").html(),
fileType: _this.attr("filetype")
};
$("#fileRightMenu").show();
$("#fileRightMenu").html(getDataUseHandlebars($("#fileRightMenuTemplate").html(), {bean: par}));
$("#fileRightMenu").css({top: e.clientY + "px", left: e.clientX + "px", visibility: "visible", position: "absolute"});
if ($.inArray(_this.attr("filetype"), officeType) == -1) {
$(".openByOnlyOffice").hide();
$(".openByMicrosoftOffice").hide();
}
}
// 加载选中
function setChooseFileContent(_this){
$(".select-op-more").find("button[class*='btn-custom']").show();
$(".select-op-more").find("li[class*='is-file']").show();
$(".select-op-more").show();
$("#file-content").find("div").removeClass("active");
// 获取创建人
var createId = _this.attr("createId");
// 权限控制
authControllerFile(createId);
// 其他选中取消
$("#file-content .menu-folder .item-select .item-check").find("input:checkbox[name='checkFile']:checked").prop("checked", false);
// 添加选中样式
_this.addClass("active");
// 设置当前选中
_this.children(".item-select").children(".item-check").find("input:checkbox[name='checkFile']").prop("checked", true);
}
// 树节点点击事件
function zTreeOnClick(event, treeId, treeNode) {
var folderName = getFilePath(treeNode);
$(".yarnball").html('<li class="yarnlet first"><a title="/">/</a></li>' + folderName);
if(treeNode.id != folderId){
folderId = treeNode.id;
loadThisFolderChild();
}
// 如果节点不展开,则展开
if(!treeNode.open){
ztree.expandNode(treeNode);
}
};
function getFileMation(id, callback) {
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "queryFileConsoleById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
if (typeof callback == "function") {
callback(json.bean)
}
}});
}
// 文件夹或者文件重命名
$("body").on("click", ".fileReName", function (e) {
reNameSpecially();
$(".layui-dropdown-menu").hide();
});
// 文件名保存
$("body").on("click", ".filename-edit-save", function (e) {
if(isNull($(this).parent().find('textarea').val())) {
winui.window.msg('请填写文件名', {icon: 2, time: 2000});
} else {
$(this).parent().parent().css({"z-index": 0});
editFolderById($(this).parent());
}
});
// 文件名取消修改
$("body").on("click", ".filename-edit-cancle", function (e) {
$(this).parent().parent().css({"z-index": 0});
$(this).parent().parent().find("div[class='filename']").show();
$(this).parent().hide();
});
// 文件夹或者文件删除
$("body").on("click", ".deleteFolderAndChild", function (e) {
// 树操作--文件夹或者文件删除
$("body").on("click", ".treedeleteFolderAndChild", function (e) {
hideRMenu();
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
var checkItems = $("#file-content .menu-folder .item-select .item-check").find("input:checkbox[name='checkFile']:checked");
var deleteArray = new Array();
$.each(checkItems, function(i, item) {
var checkFile = $(item).parent().parent().parent();
deleteArray.push({
id: checkFile.attr("rowid"),
fileType: checkFile.attr("filetype")
});
});
$(".layui-dropdown-menu").hide();
$(".select-op-more").hide();
//如果选中项为空
if(deleteArray.length == 0){
winui.window.msg('请选择要删除的文件或文件夹', {icon: 2, time: 2000});
return false;
}
deleteFolderAndChild(deleteArray, function() {
// 刷新节点
refreshTreePointNode();
// 加载该目录下的文件
loadThisFolderChild();
});
clickType = 'folder';
deleteFileOrNote(folderId);
});
});
// // 删除文件夹以及该文件夹下的所有子内容
// function deleteFolderAndChild(deleteArray, callBack){
// AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "fileconsole004", params: {fileList: JSON.stringify(deleteArray)}, type: 'json', method: 'POST', callback: function (json) {
// winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
// callBack();
// }});
// }
// 新建
$("body").on("click", "#createNewFolder", function (e) {
hideRMenu();
createFolder(folderId, refreshTreePointNode, initMenuToBox, currentUserId);
});
// 删除指定文件夹或笔记
function deleteFileOrNote(id){
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "deleteDepotLevelById", params: {id: id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
var selNode = ztree.getNodeByParam("id", id, null);
ztree.selectNode(selNode.getParentNode());// 设置选中节点
// 重置folderid
folderId = selNode.getParentNode().id;
ztree.removeNode(selNode);// 移除节点
// showListById();// 获取文件夹和笔记列表
}});
}
// 树操作--新建
$("body").on("click", ".treecreateNewFolder", function (e) {
hideRMenu();
loadThisFolderChild();
createFolder(folderId, refreshTreePointNode, initMenuToBox, currentUserId);
// 打开一个新建布局
_openNewWindows({
url: "../../tpl/turnIocatorManage/addWarehouseLevel.html?id=" + data.id,
title: "新增仓库级别",
pageId: "addWarehouseLevel",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
// 树操作--刷新
$("body").on("click", ".treerefreshContent", function (e) {
refreshTreePointNode();
loadThisFolderChild();
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
});
// 默认初始化树
var initTreeSel = false;
initRightMenu();
//初始化右键
function initRightMenu() {
$("body").contextMenu({
width: 190, // width
itemHeight: 30, // 菜单项height
bgColor: "#FFFFFF", // 背景颜色
color: "#0A0A0A", // 字体颜色
fontSize: 12, // 字体大小
hoverBgColor: "#99CC66", // hover背景颜色
target: function(ele) { // 当前元素
},
menu: [{
text: "新建",
img: "../../assets/images/icon/create-folder-icon.png",
callback: function() {
createFolder(folderId, refreshTreePointNode, initMenuToBox, currentUserId);
}
}, { // 菜单项
text: "新建文件",
img: "../../assets/images/my-file-icon.png",
children: [{
text: "txt文件",
img: "../../assets/images/txt-icon.png",
callback: function() {
createNumpyFile("txt", folderId, loadThisFolderChild());
}
}, {
text: "html文件",
img: "../../assets/images/icon/html-icon.png",
callback: function() {
createNumpyFile("html", folderId, loadThisFolderChild());
}
}, {
text: "--"
}]
}, {
text: "--"
}, {
text: "--"
}, {
text: "刷新",
img: "../../assets/images/refresh-icon.png",
callback: function() {
loadThisFolderChild();
}
}
]
});
function loadTable() {
tableTree.reload("messageTable", {where: getTableParams()});
}
// 负责view的销毁
function removeOneFile(file) {
var $li = $('#' + file.id);
delete percentages[file.id];
updateAllTotalProgress();
$li.off().find('.file-panel').off().end().remove();
function getTableParams() {
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('turnIocatorManage', {});
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div id="content"></div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" type="button" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<!-- <button class="winui-btn" lay-submit lay-filter="formSaveDraft" id="formSaveDraft">保存为草稿</button>-->
<button class="winui-btn" lay-submit lay-filter="formWriteBean" id="formWriteBean">提交</button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/turnIocatorManage/'}).use('addWarehouseLevel');
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册