|
@@ -462,6 +462,19 @@ $(document).ready(function() {
|
|
|
dialog.modal('hide');
|
|
|
}
|
|
|
|
|
|
+ // 判断同级是否有同名
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (target.data.projType === projectType.tender) {
|
|
|
parent = target.parent;
|
|
|
next = target.nextSibling;
|
|
@@ -1093,39 +1106,33 @@ function setDataToSideBar() {
|
|
|
$(target).show();
|
|
|
$(target + '-name').html(name);
|
|
|
|
|
|
- // if (selectedItem.data.projType === projectType.project) {
|
|
|
- if (selectedItem.children.length <= 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- // 建设项目相关
|
|
|
- let counter = 1;
|
|
|
- let html = '';
|
|
|
- for(let tmp of selectedItem.children) {
|
|
|
- html += '<tr>' +
|
|
|
- '<td>'+ counter +'</td>' +
|
|
|
- '<td>'+ counter +'</td>' +
|
|
|
- '<td>'+ tmp.data.name +'</td>' +
|
|
|
- '<td></td>' +
|
|
|
- '<td></td>' +
|
|
|
- '<td></td>' +
|
|
|
- '<td></td>' +
|
|
|
- '</tr>';
|
|
|
-
|
|
|
- }
|
|
|
+ if (selectedItem.children.length <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 建设项目相关
|
|
|
+ let counter = 1;
|
|
|
+ let html = '';
|
|
|
+ for(let tmp of selectedItem.children) {
|
|
|
html += '<tr>' +
|
|
|
- '<td>'+ (counter + 1) +'</td>' +
|
|
|
- '<td> </td>' +
|
|
|
- '<td>合计</td>' +
|
|
|
+ '<td>'+ counter +'</td>' +
|
|
|
+ '<td>'+ counter +'</td>' +
|
|
|
+ '<td>'+ tmp.data.name +'</td>' +
|
|
|
'<td></td>' +
|
|
|
'<td></td>' +
|
|
|
'<td></td>' +
|
|
|
'<td></td>' +
|
|
|
'</tr>';
|
|
|
- $(target + '-table tbody').html(html);
|
|
|
- // } else {
|
|
|
- // 单项工程相关
|
|
|
-
|
|
|
- // }
|
|
|
|
|
|
+ }
|
|
|
+ html += '<tr>' +
|
|
|
+ '<td>'+ (counter + 1) +'</td>' +
|
|
|
+ '<td> </td>' +
|
|
|
+ '<td>合计</td>' +
|
|
|
+ '<td></td>' +
|
|
|
+ '<td></td>' +
|
|
|
+ '<td></td>' +
|
|
|
+ '<td></td>' +
|
|
|
+ '</tr>';
|
|
|
+ $(target + '-table tbody').html(html);
|
|
|
|
|
|
}
|