|
@@ -386,6 +386,11 @@
|
|
|
let itemsSpread = new GC.Spread.Sheets.Workbook($("#spreadItems")[0], {sheetCount: 1});
|
|
|
itemsSpread.options.allowUserDragFill = false;
|
|
|
sheetCommonObj.bindEscKey(itemsSpread, [{sheet: itemsSpread.getSheet(0), editStarting: itemsController.onEditStart, editEnded: itemsController.onEditEnded}]);
|
|
|
+ const billKindComboList = [
|
|
|
+ { name: '大项费用', value: 1 },
|
|
|
+ { name: '项目节', value: 8 },
|
|
|
+ { name: '清单', value: 4 },
|
|
|
+ ];
|
|
|
$(document).ready(function(){
|
|
|
$("#aStdJobs").attr('href', function(){
|
|
|
return `stdJobs?billsLibId=${billsLibId}&locked=${locked}`;
|
|
@@ -490,6 +495,12 @@
|
|
|
data.fixedFlag = findData.name;
|
|
|
}
|
|
|
}
|
|
|
+ if (data.kind) {
|
|
|
+ const kindItem = billKindComboList.find(item => item.value === data.kind);
|
|
|
+ if (kindItem) {
|
|
|
+ data.kind = kindItem.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
billsTree.loadDatas(datas);
|
|
|
let controller = TREE_SHEET_CONTROLLER.createNew(billsTree.tree, billsSpread.getActiveSheet(), setting);
|
|
@@ -523,6 +534,11 @@
|
|
|
nodeOpration(controller, totalJobs, totalItems);
|
|
|
});
|
|
|
});
|
|
|
+ // 设置类别下拉
|
|
|
+ const kindCol = setting.cols.findIndex((data) => data.data.field === 'kind');
|
|
|
+ const kindList = billKindComboList.map(item => item.name);
|
|
|
+ setCombo(billsSheet, kindCol, kindList);
|
|
|
+ // 设置固定清单下拉
|
|
|
let nameList = BillsFixedFlagList.map((data) => data.name);
|
|
|
let comboCol = setting.cols.findIndex((data) => data.data.field === 'fixedFlag');
|
|
|
setCombo(billsSheet, comboCol, nameList);
|
|
@@ -824,12 +840,13 @@
|
|
|
}
|
|
|
else if(i < controller.tree.items.length && j>= validDatas.length){
|
|
|
//reshow orgDatas
|
|
|
- sheet.setValue(i, 0, sheetBillsDatas.datasIdx['rowIdx'+ i].code + '');
|
|
|
- sheet.setValue(i, 1, sheetBillsDatas.datasIdx['rowIdx'+ i].name);
|
|
|
- sheet.setValue(i, 2, sheetBillsDatas.datasIdx['rowIdx'+ i].unit);
|
|
|
- sheet.setValue(i, 3, sheetBillsDatas.datasIdx['rowIdx'+ i].ruleText);
|
|
|
- sheet.setValue(i, 4, sheetBillsDatas.datasIdx['rowIdx'+ i].engineering);
|
|
|
- sheet.setValue(i, 5, sheetBillsDatas.datasIdx['rowIdx'+ i].fixedFlag);
|
|
|
+ sheet.setValue(i, 0, sheetBillsDatas.datasIdx['rowIdx'+ i].kind);
|
|
|
+ sheet.setValue(i, 1, sheetBillsDatas.datasIdx['rowIdx'+ i].code + '');
|
|
|
+ sheet.setValue(i, 2, sheetBillsDatas.datasIdx['rowIdx'+ i].name);
|
|
|
+ sheet.setValue(i, 3, sheetBillsDatas.datasIdx['rowIdx'+ i].unit);
|
|
|
+ sheet.setValue(i, 4, sheetBillsDatas.datasIdx['rowIdx'+ i].ruleText);
|
|
|
+ sheet.setValue(i, 5, sheetBillsDatas.datasIdx['rowIdx'+ i].engineering);
|
|
|
+ sheet.setValue(i, 6, sheetBillsDatas.datasIdx['rowIdx'+ i].fixedFlag);
|
|
|
}
|
|
|
else {
|
|
|
sheet.clear(i, 0, 1, sheet.getColumnCount(), GC.Spread.Sheets.SheetArea.viewport,GC.Spread.Sheets.StorageType.data);
|
|
@@ -860,16 +877,39 @@
|
|
|
}
|
|
|
curRow = row;
|
|
|
const field = setting.cols[col].data.field;
|
|
|
- const value = sheet.getValue(row, col);
|
|
|
+ let value = sheet.getValue(row, col);
|
|
|
+ if (field === 'fixedFlag') {
|
|
|
+ const findData = BillsFixedFlagList.find((x) => x.name === value);
|
|
|
+ if (findData) {
|
|
|
+ value = findData.value;
|
|
|
+ }
|
|
|
+ } else if (field === 'kind') {
|
|
|
+ const kindItem = billKindComboList.find(item => item.name === value);
|
|
|
+ if (kindItem) {
|
|
|
+ value = kindItem.value;
|
|
|
+ }
|
|
|
+ }
|
|
|
curData[field] = value;
|
|
|
});
|
|
|
billsAjax.pasteBills(userAccount, billsLibId, postData, function () {
|
|
|
info.changedCells.forEach(({ row, col }) => {
|
|
|
const node = controller.tree.items[row];
|
|
|
const field = setting.cols[col].data.field;
|
|
|
- const value = sheet.getValue(row, col);
|
|
|
+ let value = sheet.getValue(row, col);
|
|
|
+ if (field === 'fixedFlag') {
|
|
|
+ const findData = BillsFixedFlagList.find((x) => x.value === value);
|
|
|
+ if (findData) {
|
|
|
+ value = findData.name;
|
|
|
+ }
|
|
|
+ } else if (field === 'kind') {
|
|
|
+ const kindItem = billKindComboList.find(item => item.value === value);
|
|
|
+ if (kindItem) {
|
|
|
+ value = kindItem.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
node.data[field] = value;
|
|
|
sheetBillsDatas.datasIdx['rowIdx' + row][field] = value;
|
|
|
+ sheet.setValue(row, col, node.data[field] || '');
|
|
|
});
|
|
|
}, function () {
|
|
|
info.changedCells.forEach(({ row, col }) => {
|