|
@@ -136,12 +136,31 @@ const billsGuidance = (function () {
|
|
|
tree: null,
|
|
|
controller: null,
|
|
|
treeSetting: {
|
|
|
- treeCol: 0,
|
|
|
+ treeCol: 1,
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
|
headRowHeight: [40],
|
|
|
defaultRowHeight: 21,
|
|
|
- cols: [{
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ width: 35,
|
|
|
+ readOnly: false,
|
|
|
+ head: {
|
|
|
+ titleNames: ["选择"],
|
|
|
+ spanCols: [1],
|
|
|
+ spanRows: [1],
|
|
|
+ vAlign: [1],
|
|
|
+ hAlign: [1],
|
|
|
+ font: ["Arial"]
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ field: "select",
|
|
|
+ vAlign: 1,
|
|
|
+ hAlign: 1,
|
|
|
+ font: "Arial"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
width: 420,
|
|
|
readOnly: false,
|
|
|
head: {
|
|
@@ -158,30 +177,12 @@ const billsGuidance = (function () {
|
|
|
hAlign: 0,
|
|
|
font: "Arial"
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- width: 35,
|
|
|
- readOnly: false,
|
|
|
- head: {
|
|
|
- titleNames: ["选择"],
|
|
|
- spanCols: [1],
|
|
|
- spanRows: [1],
|
|
|
- vAlign: [1],
|
|
|
- hAlign: [1],
|
|
|
- font: ["Arial"]
|
|
|
- },
|
|
|
- data: {
|
|
|
- field: "select",
|
|
|
- vAlign: 1,
|
|
|
- hAlign: 1,
|
|
|
- font: "Arial"
|
|
|
- }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
headers: [
|
|
|
- {name: '项目指引', dataCode: 'name', width: 300, vAlign: 'center', hAlign: 'left', formatter: '@'},
|
|
|
{name: '选择', dataCode: 'select', width: 35, vAlign: 'center', hAlign: 'center', formatter: '@'},
|
|
|
+ {name: '项目指引', dataCode: 'name', width: 300, vAlign: 'center', hAlign: 'left', formatter: '@'},
|
|
|
],
|
|
|
events: {
|
|
|
EditStarting: function (sender, args) {
|
|
@@ -193,6 +194,7 @@ const billsGuidance = (function () {
|
|
|
if(args.sheet.isEditing()){
|
|
|
args.sheet.endEdit(true);
|
|
|
}
|
|
|
+ refreshInsertRation();
|
|
|
},
|
|
|
CellDoubleClick: function (sender, args) {
|
|
|
if(!bills.tree || !bills.tree.selected){
|
|
@@ -301,8 +303,8 @@ const billsGuidance = (function () {
|
|
|
}
|
|
|
if(module === guideItem){
|
|
|
sheet.options.isProtected = true;
|
|
|
- sheet.getRange(-1, 1, -1, 1).locked(false);
|
|
|
- sheet.getRange(-1, 0, -1, 1).locked(true);
|
|
|
+ sheet.getRange(-1, 0, -1, 1).locked(false);
|
|
|
+ sheet.getRange(-1, 1, -1, 1).locked(true);
|
|
|
}
|
|
|
setOptions(module.workBook, options);
|
|
|
buildHeader(module.workBook.getActiveSheet(), module.headers);
|
|
@@ -358,18 +360,19 @@ const billsGuidance = (function () {
|
|
|
const sheet = guideItem.workBook.getActiveSheet();
|
|
|
renderSheetFunc(sheet, function(){
|
|
|
for(let node of nodes){
|
|
|
- sheet.setCellType(node.serialNo(), 1, node.data.type === itemType.ration ? checkBox : base);
|
|
|
+ sheet.setCellType(node.serialNo(), 0, node.data.type === itemType.ration ? checkBox : base);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//清单表焦点控制
|
|
|
//@param {Number}row @return {void}
|
|
|
function billsInitSel(row){
|
|
|
+ let guideSheet = guideItem.workBook.getActiveSheet();
|
|
|
+ cleanData(guideSheet, guideItem.headers, -1);
|
|
|
+ refreshInsertRation();
|
|
|
if(!bills.tree){
|
|
|
return;
|
|
|
}
|
|
|
- let guideSheet = guideItem.workBook.getActiveSheet();
|
|
|
- cleanData(guideSheet, guideItem.headers, -1);
|
|
|
let node = bills.tree.items[row];
|
|
|
if(!node){
|
|
|
return;
|
|
@@ -466,7 +469,7 @@ const billsGuidance = (function () {
|
|
|
let rst = [];
|
|
|
let itemSheet = guideItem.workBook.getActiveSheet();
|
|
|
for(let row = 0; row < itemSheet.getRowCount(); row++){
|
|
|
- let rowV = itemSheet.getValue(row, 1);
|
|
|
+ let rowV = itemSheet.getValue(row, 0);
|
|
|
if(rowV){
|
|
|
rst.push(row);
|
|
|
}
|
|
@@ -494,15 +497,26 @@ const billsGuidance = (function () {
|
|
|
let sheet = guideItem.workBook.getActiveSheet();
|
|
|
renderSheetFunc(sheet, function () {
|
|
|
for(let row = 0; row < sheet.getRowCount(); row++){
|
|
|
- if(sheet.getValue(row, 1)){
|
|
|
- sheet.setValue(row, 1, false);
|
|
|
+ if(sheet.getValue(row, 0)){
|
|
|
+ sheet.setValue(row, 0, false);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ refreshInsertRation();
|
|
|
projectObj.setActiveCell('quantity', true);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ //更新插入定额按钮有效性
|
|
|
+ function refreshInsertRation(){
|
|
|
+ //勾选了定额,插入定额按钮才有效
|
|
|
+ if(getCheckedRows().length > 0){
|
|
|
+ $('#guidanceInsertRation').removeClass('disabled');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $('#guidanceInsertRation').addClass('disabled');
|
|
|
+ }
|
|
|
+ }
|
|
|
//展开至搜索出来点的节点
|
|
|
//@param {Array}nodes @return {void}
|
|
|
function expandSearchNodes(nodes){
|
|
@@ -646,7 +660,7 @@ const billsGuidance = (function () {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return {initViews, bindBtn, refreshWorkBook, bills};
|
|
|
+ return {initViews, bindBtn, refreshWorkBook, refreshInsertRation, bills};
|
|
|
})();
|
|
|
|
|
|
$(document).ready(function(){
|