|
@@ -130,32 +130,24 @@ let subViewObj = {
|
|
|
},
|
|
|
loadComments: function (node) {
|
|
|
let select = node;
|
|
|
- if (select && select.sourceType === projectObj.project.Bills.getSourceType()) {
|
|
|
- $('#fxComments>textarea').val(select.data.comments).removeAttr('readOnly');
|
|
|
- } else {
|
|
|
- $('#fxComments>textarea').val('').attr('readOnly', true);
|
|
|
- }
|
|
|
- if (select && select.sourceType === projectObj.project.Ration.getSourceType()) {
|
|
|
- $('#rationComments>textarea').val(select.data.comments).removeAttr('readOnly');
|
|
|
+ if (node && (node.sourceType === projectObj.project.Bills.getSourceType() || node.sourceType === projectObj.project.Ration.getSourceType())) {
|
|
|
+ $('#comments>textarea').val(node.data.comments).removeAttr('readOnly');
|
|
|
} else {
|
|
|
$('#rationComments>textarea').val('').attr('readOnly', true);
|
|
|
}
|
|
|
},
|
|
|
saveComments: function (node) {
|
|
|
- let select = node;
|
|
|
- if (select.sourceType === projectObj.project.Bills.getSourceType()) {
|
|
|
- let text = $('#fxComments>textarea').val();
|
|
|
- if (select.data.comments !== text) {
|
|
|
- projectObj.project.Bills.updateField(select.source, 'comments', text);
|
|
|
+ let text = $('#comments>textarea').val();
|
|
|
+ if (node && node.sourceType === projectObj.project.Bills.getSourceType()) {
|
|
|
+ if (node.data.comments !== text) {
|
|
|
+ projectObj.project.Bills.updateField(node.source, "comments", text);
|
|
|
}
|
|
|
- } else if (select.sourceType === projectObj.project.Ration.getSourceType()) {
|
|
|
- let text = $('#rationComments>textarea').val();
|
|
|
- if (select.data.comments !== text) {
|
|
|
- projectObj.project.Ration.updateField(select.source, 'comments', text);
|
|
|
+ } else if (node && node.sourceType === projectObj.project.Ration.getSourceType()) {
|
|
|
+ if (node.data.comments !== text) {
|
|
|
+ projectObj.project.Ration.updateField(node.source, "comments", text);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-$("#linkFXSM").click(subViewObj.linkTabClick);
|
|
|
-$("#linkDESM").click(subViewObj.linkTabClick);
|
|
|
+$("#linkComments").click(subViewObj.linkTabClick);
|