|
@@ -45,12 +45,15 @@ var rationLibObj = {
|
|
|
loadStdRationLibs: function () {
|
|
|
let select = $('#stdRationLibSelect');
|
|
|
select.empty();
|
|
|
-
|
|
|
let ration_lib = projectInfoObj.projectInfo.engineeringInfo.ration_lib;
|
|
|
+ ration_lib.push({
|
|
|
+ isDefault: false,
|
|
|
+ id: rationLibObj.compleRationLibId,
|
|
|
+ name: '我的补充定额'
|
|
|
+ });
|
|
|
let selectedRationLib = sessionStorage.getItem('stdRationLib');
|
|
|
ration_lib.forEach(function (data) {
|
|
|
let option = $('<option>').val(data.id).text(data.name);
|
|
|
- //select.append($('<option>').val(data.id).text(data.name));
|
|
|
if(selectedRationLib){
|
|
|
if(data.id == selectedRationLib){
|
|
|
option.attr('selected', 'selected');
|
|
@@ -61,8 +64,8 @@ var rationLibObj = {
|
|
|
select.append(option);
|
|
|
});
|
|
|
//我的补充定额库
|
|
|
- let $opt = $('<option>').val(rationLibObj.compleRationLibId).text('我的补充定额');
|
|
|
- select.append($opt);
|
|
|
+ /* let $opt = $('<option>').val(rationLibObj.compleRationLibId).text('我的补充定额');
|
|
|
+ select.append($opt);*/
|
|
|
if (select[0].options.length !== 0) {
|
|
|
rationLibObj.loadStdRation(select.val());
|
|
|
}
|
|
@@ -186,7 +189,7 @@ var rationLibObj = {
|
|
|
onRationSpreadCellDoubleClick: function (sender, args) {
|
|
|
var select = $('#stdRationLibSelect'), rationCode = args.sheet.getText(args.row, 0);
|
|
|
if (rationCode !== '') {
|
|
|
- let query = {userID: userID, code: rationCode};
|
|
|
+ let query = {userID: userID, rationRepId: select.val(), code: rationCode};
|
|
|
//搜索结果全部定额中双击添加定额、有可能同名不同库,更新查询的库ID
|
|
|
if (rationLibObj.resultCache && rationLibObj.resultCache[args.row]) {
|
|
|
query.rationRepId = rationLibObj.resultCache[args.row].type === 'std' ? rationLibObj.resultCache[args.row].rationRepId : rationLibObj.compleRationLibId;
|
|
@@ -536,7 +539,6 @@ $('#rationSearch').click(function () {
|
|
|
for(let lib of projectInfoObj.projectInfo.engineeringInfo.ration_lib){
|
|
|
rationLibIDs.push(lib.id);
|
|
|
}
|
|
|
- rationLibIDs.push(rationLibObj.compleRationLibId);
|
|
|
}
|
|
|
let bindContextmenuOpr = function (sheet) {
|
|
|
$.contextMenu({
|