|
@@ -342,8 +342,7 @@ $(document).ready(function() {
|
|
|
dialog.modal('hide');
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- RenameProject(select.id(), newName, function () {
|
|
|
+ RenameProject(select.id(), newName, select.data.ParentID, function () {
|
|
|
dialog.modal('hide');
|
|
|
select.data.name = newName;
|
|
|
Tree.refreshNodesDom([select]);
|
|
@@ -364,6 +363,7 @@ $(document).ready(function() {
|
|
|
|
|
|
// 移动到操作
|
|
|
$('#move-to-confirm').click(function () {
|
|
|
+ console.log(111);
|
|
|
let updateData = null;
|
|
|
let dialog = $('#move-to-dialog');
|
|
|
let target = GetTargetTreeNode($.fn.zTree.getZTreeObj('treeDemo'));
|
|
@@ -377,6 +377,18 @@ $(document).ready(function() {
|
|
|
alert("请移动到单项工程中!");
|
|
|
return false;
|
|
|
}
|
|
|
+ // 判断同级是否有同名
|
|
|
+ if (target.children.length > 0) {
|
|
|
+ for (let tmp in target.children) {
|
|
|
+ if (tmp === 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (target.children[tmp].data.name === cur.data.name) {
|
|
|
+ alert("对应单项工程中存在同名数据!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
let parent = target;
|
|
|
let next = target.firstChild();
|
|
@@ -500,6 +512,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
$("#tender-fee-rate").html(feeHtml);
|
|
|
|
|
|
+ $(this).parent().siblings('.hidden-area').slideDown('fast');
|
|
|
});
|
|
|
});
|
|
|
|
|
@@ -696,6 +709,7 @@ function AddTender() {
|
|
|
$('#tender-name').val('');
|
|
|
$("#tender-fee-rate").children("option").removeAttr("selected");
|
|
|
$("#tender-engineering").children("option").removeAttr("selected");
|
|
|
+ $(".hidden-area").hide();
|
|
|
};
|
|
|
let selectedItem = Tree.selected();
|
|
|
let tenderInfo = {
|
|
@@ -727,6 +741,10 @@ function AddFolder() {
|
|
|
}
|
|
|
|
|
|
let selectedItem = Tree.selected();
|
|
|
+ let callback = function() {
|
|
|
+ $("#add-folder-dialog").modal("hide");
|
|
|
+ $("#folder-name").val('');
|
|
|
+ };
|
|
|
if (selectedItem !== null) {
|
|
|
// 判断是否超过3层
|
|
|
if (selectedItem.parent !== null && selectedItem.parent.parent !== null &&
|
|
@@ -734,13 +752,9 @@ function AddFolder() {
|
|
|
alert("文件夹不能超过3层");
|
|
|
return false;
|
|
|
}
|
|
|
- AddChildrenItem(name, null, projectType.folder, function() {
|
|
|
- $("#add-folder-dialog").modal("hide");
|
|
|
- });
|
|
|
+ AddChildrenItem(name, null, projectType.folder, callback);
|
|
|
} else {
|
|
|
- AddSiblingsItem(name, null, projectType.folder, function() {
|
|
|
- $("#add-folder-dialog").modal("hide");
|
|
|
- });
|
|
|
+ AddSiblingsItem(name, null, projectType.folder, callback);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -864,14 +878,15 @@ function GetNewProjectId(callback) {
|
|
|
*
|
|
|
* @param {Number} projectId
|
|
|
* @param {String} newName
|
|
|
+ * @param {Number} parentID
|
|
|
* @param {function} callback
|
|
|
* @return {void}
|
|
|
*/
|
|
|
-function RenameProject(projectId, newName, callback) {
|
|
|
+function RenameProject(projectId, newName, parentID, callback) {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: '/pm/api/renameProject',
|
|
|
- data: {'data': JSON.stringify({"user_id": userID, "id": projectId, "newName": newName})},
|
|
|
+ data: {'data': JSON.stringify({"user_id": userID, "id": projectId, "newName": newName, "parentID": parentID})},
|
|
|
dataType: 'json',
|
|
|
cache: false,
|
|
|
timeout: 5000,
|