|
|
@@ -331,7 +331,8 @@ const billsGuidance = (function () {
|
|
|
return;
|
|
|
}
|
|
|
bills.tree.selected = node;
|
|
|
-
|
|
|
+ //显示备注
|
|
|
+ $('.main-side-bottom').find('textarea').val(node.data.comment ? node.data.comment : '');
|
|
|
if(!node.guidance.tree){
|
|
|
getItemsByBills(libID, node.data.ID, function (rstData) {
|
|
|
initTree(node.guidance, guideSheet, guideItem.treeSetting, rstData);
|
|
|
@@ -814,10 +815,12 @@ const billsGuidance = (function () {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+ let billsLibId = 0;
|
|
|
//获取指引库信息及关联的清单
|
|
|
//@param {Number}libID {Function}callback @return {Object}
|
|
|
function getLibWithBills(libID, callback){
|
|
|
CommonAjax.post('/billsGuidance/api/getLibWithBills', {libID: libID}, function (rstData) {
|
|
|
+ billsLibId = rstData.guidanceLib.billsLibId;
|
|
|
initRationLibs(rstData.guidanceLib.compilationId);
|
|
|
bills.cache = rstData.bills;
|
|
|
initLibName(rstData.guidanceLib.name);
|
|
|
@@ -859,6 +862,14 @@ const billsGuidance = (function () {
|
|
|
setBillsHint(bills.tree.items, stdBillsJobData, stdBillsFeatureData);
|
|
|
}
|
|
|
}
|
|
|
+ //更新清单备注
|
|
|
+ function updateBillsComment(updateData, callback) {
|
|
|
+ CommonAjax.post('/stdBillsEditor/updateBills', updateData, function () {
|
|
|
+ if (callback) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
//更新项目指引
|
|
|
//@param {Array}updateDatas {Function}callback @return {void}
|
|
|
function updateGuideItems(updateDatas, callback){
|
|
|
@@ -1669,20 +1680,50 @@ const billsGuidance = (function () {
|
|
|
//恢复章节树下的定额
|
|
|
sectionInitSel(section.workBook.getActiveSheet().getActiveRowIndex());
|
|
|
});
|
|
|
+ let keyupTime = 0,
|
|
|
+ delayTime = 500;
|
|
|
+ function delayKeyup(callback) {
|
|
|
+ let nowTime = Date.now();
|
|
|
+ keyupTime = nowTime;
|
|
|
+ setTimeout(function () {
|
|
|
+ if (nowTime - keyupTime == 0) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }, delayTime);
|
|
|
+ }
|
|
|
//执行搜索
|
|
|
$('#searchText').keyup(function (e) {
|
|
|
- $('#searchBtn').click();
|
|
|
+ delayKeyup(function () {
|
|
|
+ $('#searchBtn').click();
|
|
|
+ });
|
|
|
});
|
|
|
- //编辑备注
|
|
|
+ //编辑清单备注
|
|
|
+ $('.main-side-bottom').find('textarea').keyup(function () {
|
|
|
+ let me = this;
|
|
|
+ let node = bills.tree.selected;
|
|
|
+ let comment = $(me).val();
|
|
|
+ delayKeyup(function () {
|
|
|
+ if (node) {
|
|
|
+ let updateData = {lastOperator: userAccount, billsLibId: billsLibId, updateId: node.getID(), field: 'comment', data: comment};
|
|
|
+ updateBillsComment(updateData, function () {
|
|
|
+ node.data.comment = comment;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //编辑选项备注
|
|
|
$('.main-bottom-content').find('textarea').keyup(function () {
|
|
|
+ let me = this;
|
|
|
let node = bills.tree.selected.guidance.tree.selected;
|
|
|
- if(node){
|
|
|
- let comment = $(this).val();
|
|
|
- let updateDatas = [{updateType: updateType.update, findData: {ID: node.getID()}, updateData: {comment: comment}}];
|
|
|
- updateGuideItems(updateDatas, function (rstData) {
|
|
|
- node.data.comment = comment;
|
|
|
- });
|
|
|
- }
|
|
|
+ let comment = $(me).val();
|
|
|
+ delayKeyup(function () {
|
|
|
+ if(node){
|
|
|
+ let updateDatas = [{updateType: updateType.update, findData: {ID: node.getID()}, updateData: {comment: comment}}];
|
|
|
+ updateGuideItems(updateDatas, function (rstData) {
|
|
|
+ node.data.comment = comment;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
//定额高度拖动调整
|
|
|
slideResize(rationLibResizeEles, {min: 147, max: 680}, 'height', function() {
|