|
@@ -7,6 +7,7 @@ $(function () {
|
|
|
let usedCom;
|
|
let usedCom;
|
|
|
let deleteCount = 0;
|
|
let deleteCount = 0;
|
|
|
let preDeleteId = null;
|
|
let preDeleteId = null;
|
|
|
|
|
+ let selCompilationId;
|
|
|
$('#del').on('hidden.bs.modal', function () {
|
|
$('#del').on('hidden.bs.modal', function () {
|
|
|
deleteCount = 0;
|
|
deleteCount = 0;
|
|
|
});
|
|
});
|
|
@@ -186,6 +187,45 @@ $(function () {
|
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ //设置补充人材机库分类树模板
|
|
|
|
|
+ $("#showArea").on("click", ".set-comple", function () {
|
|
|
|
|
+ let id = $(this).data("id");
|
|
|
|
|
+ id = parseInt(id);
|
|
|
|
|
+ if (isNaN(id) || id <= 0) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ selLibId = id;
|
|
|
|
|
+ $('#templateA').addClass('disabled');
|
|
|
|
|
+ $('#template').modal('show');
|
|
|
|
|
+ $('#compilations').empty();
|
|
|
|
|
+ for (let data of compilationsArr) {
|
|
|
|
|
+ let $opt = $(`<option value="${data._id}">${data.name}</option>`);
|
|
|
|
|
+ $('#compilations').append($opt);
|
|
|
|
|
+ }
|
|
|
|
|
+ $('#compilations').change();
|
|
|
|
|
+ });
|
|
|
|
|
+ $('#compilations').change(function () {
|
|
|
|
|
+ selCompilationId = $(this).select().val();
|
|
|
|
|
+ CommonAjax.get(`api/classTemplateCount/${selCompilationId}`, function (rstData) {
|
|
|
|
|
+ rstData.data.count > 0 ?
|
|
|
|
|
+ $('#templateText').text('该费用定额下已有人材机分类树模板数据,是否确认覆盖数据?') :
|
|
|
|
|
+ $('#templateText').text('确认是否将此库的分类树设置成该费用定额下补充人材机分类树模板?');
|
|
|
|
|
+ $('#templateA').removeClass('disabled');
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ $('#templateA').click(function () {
|
|
|
|
|
+ if (selLibId <= 0 && selCompilationId) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $.bootstrapLoading.start();
|
|
|
|
|
+ CommonAjax.post('api/initClassTemplate', {gljLibId: selLibId, compilationId: selCompilationId}, function () {
|
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
|
+ $('#template').modal('hide');
|
|
|
|
|
+ }, function () {
|
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
|
+ $('#template').modal('hide');
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function getAllGljLib(callback){
|
|
function getAllGljLib(callback){
|
|
@@ -203,6 +243,7 @@ function getAllGljLib(callback){
|
|
|
let libName = result.data[i].dispName;
|
|
let libName = result.data[i].dispName;
|
|
|
let createDate = result.data[i].createDate.split(' ')[0];
|
|
let createDate = result.data[i].createDate.split(' ')[0];
|
|
|
let compilationName = result.data[i].compilationName;
|
|
let compilationName = result.data[i].compilationName;
|
|
|
|
|
+ let compilationId = result.data[i].compilationId;
|
|
|
let rationLibs = result.data[i].rationLibs;
|
|
let rationLibs = result.data[i].rationLibs;
|
|
|
let rationLibsName = '';
|
|
let rationLibsName = '';
|
|
|
for(let j = 0; j < rationLibs.length; j++){
|
|
for(let j = 0; j < rationLibs.length; j++){
|
|
@@ -210,7 +251,7 @@ function getAllGljLib(callback){
|
|
|
}
|
|
}
|
|
|
dispNames.push(result.data[i].dispName);
|
|
dispNames.push(result.data[i].dispName);
|
|
|
$("#showArea").append(
|
|
$("#showArea").append(
|
|
|
- "<tr id='tempId'>" +
|
|
|
|
|
|
|
+ "<tr id='tempId' data-compilationId='"+ compilationId + "'>" +
|
|
|
"<td><a href='/stdGljRepository/glj'>"+libName+"</a></td>" +
|
|
"<td><a href='/stdGljRepository/glj'>"+libName+"</a></td>" +
|
|
|
"<td>"+compilationName+" </td>" +
|
|
"<td>"+compilationName+" </td>" +
|
|
|
"<td>"+rationLibsName+" </td>" +
|
|
"<td>"+rationLibsName+" </td>" +
|
|
@@ -219,6 +260,7 @@ function getAllGljLib(callback){
|
|
|
"<i class='fa fa-pencil-square-o'></i></a> <a href='javascript:void(0);' data-toggle='modal' data-target='#del' class='text-danger' title='删除'>" +
|
|
"<i class='fa fa-pencil-square-o'></i></a> <a href='javascript:void(0);' data-toggle='modal' data-target='#del' class='text-danger' title='删除'>" +
|
|
|
"<i class='fa fa-remove'></i></a></td>" +
|
|
"<i class='fa fa-remove'></i></a></td>" +
|
|
|
"<td><a class='btn btn-secondary btn-sm import-data' href='javacript:void(0);' data-id='"+ id +"' title='导入数据'><i class='fa fa-sign-in fa-rotate-90'></i>导入</a></td>" +
|
|
"<td><a class='btn btn-secondary btn-sm import-data' href='javacript:void(0);' data-id='"+ id +"' title='导入数据'><i class='fa fa-sign-in fa-rotate-90'></i>导入</a></td>" +
|
|
|
|
|
+ "<td><a class='btn btn-secondary btn-sm set-comple' href='javacript:void(0);' data-id='"+ id +"' title='将分类树设为补充模板数据'><i class='fa fa-sign-in fa-rotate-90'></i>设置</a></td>" +
|
|
|
"</tr>");
|
|
"</tr>");
|
|
|
var newHref = "/stdGljRepository/glj?gljLibId="+id;
|
|
var newHref = "/stdGljRepository/glj?gljLibId="+id;
|
|
|
$("#tempId td:first a").attr("href", newHref);
|
|
$("#tempId td:first a").attr("href", newHref);
|
|
@@ -262,7 +304,7 @@ function createGljLib(gljLibObj, dispNamesArr, usedCom){
|
|
|
dispNamesArr.push(libName);
|
|
dispNamesArr.push(libName);
|
|
|
usedCom.push(gljLibObj.compilationId);
|
|
usedCom.push(gljLibObj.compilationId);
|
|
|
$("#showArea").append(
|
|
$("#showArea").append(
|
|
|
- "<tr id='tempId'>" +
|
|
|
|
|
|
|
+ "<tr id='tempId' data-compilationId='"+ gljLibObj.compilationId + "'>" +
|
|
|
"<td><a href='/stdGljRepository/glj'>"+libName+"</a></td>" +
|
|
"<td><a href='/stdGljRepository/glj'>"+libName+"</a></td>" +
|
|
|
"<td>"+compilationName+" </td>" +
|
|
"<td>"+compilationName+" </td>" +
|
|
|
"<td>"+''+" </td>" +
|
|
"<td>"+''+" </td>" +
|
|
@@ -271,6 +313,7 @@ function createGljLib(gljLibObj, dispNamesArr, usedCom){
|
|
|
"<i class='fa fa-pencil-square-o'></i></a> <a href='javascript:void(0);' data-toggle='modal' data-target='#del' class='text-danger' title='删除'>" +
|
|
"<i class='fa fa-pencil-square-o'></i></a> <a href='javascript:void(0);' data-toggle='modal' data-target='#del' class='text-danger' title='删除'>" +
|
|
|
"<i class='fa fa-remove'></i></a></td>" +
|
|
"<i class='fa fa-remove'></i></a></td>" +
|
|
|
"<td><a class='btn btn-secondary btn-sm import-data' href='javacript:void(0);' data-id='"+ id +"' title='导入数据'><i class='fa fa-sign-in fa-rotate-90'></i>导入</a></td>" +
|
|
"<td><a class='btn btn-secondary btn-sm import-data' href='javacript:void(0);' data-id='"+ id +"' title='导入数据'><i class='fa fa-sign-in fa-rotate-90'></i>导入</a></td>" +
|
|
|
|
|
+ "<td><a class='btn btn-secondary btn-sm set-comple' href='javacript:void(0);' data-id='"+ id +"' title='将分类树设为补充模板数据'><i class='fa fa-sign-in fa-rotate-90'></i>设置</a></td>" +
|
|
|
"</tr>");
|
|
"</tr>");
|
|
|
var newHref = "/stdGljRepository/glj?gljLibId="+id;
|
|
var newHref = "/stdGljRepository/glj?gljLibId="+id;
|
|
|
$("#tempId td:first a").attr("href", newHref);
|
|
$("#tempId td:first a").attr("href", newHref);
|