|
@@ -28,7 +28,7 @@ const billsGuidance = (function () {
|
|
|
headRowHeight: [40],
|
|
|
defaultRowHeight: 21,
|
|
|
cols: [{
|
|
|
- width: 200,
|
|
|
+ width: 160,
|
|
|
readOnly: true,
|
|
|
head: {
|
|
|
titleNames: ["项目编码"],
|
|
@@ -45,7 +45,7 @@ const billsGuidance = (function () {
|
|
|
font: "Arial"
|
|
|
}
|
|
|
}, {
|
|
|
- width: 200,
|
|
|
+ width: 220,
|
|
|
readOnly: true,
|
|
|
head: {
|
|
|
titleNames: ["项目名称"],
|
|
@@ -61,17 +61,40 @@ const billsGuidance = (function () {
|
|
|
hAlign: 0,
|
|
|
font: "Arial"
|
|
|
}
|
|
|
- }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ readOnly: true,
|
|
|
+ head: {
|
|
|
+ titleNames: ["计量单位"],
|
|
|
+ spanCols: [1],
|
|
|
+ spanRows: [1],
|
|
|
+ vAlign: [1],
|
|
|
+ hAlign: [1],
|
|
|
+ font: ["Arial"]
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ field: "unit",
|
|
|
+ vAlign: 1,
|
|
|
+ hAlign: 1,
|
|
|
+ font: "Arial"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
headers: [
|
|
|
- {name: '项目编码', dataCode: 'code', width: 200, vAlign: 'center', hAlign: 'left', formatter: '@'},
|
|
|
- {name: '项目名称', dataCode: 'name', width: 200, vAlign: 'center', hAlign: 'left', formatter: '@'}
|
|
|
+ {name: '项目编码', dataCode: 'code', width: 160, vAlign: 'center', hAlign: 'left', formatter: '@'},
|
|
|
+ {name: '项目名称', dataCode: 'name', width: 220, vAlign: 'center', hAlign: 'left', formatter: '@'},
|
|
|
+ {name: '单位', dataCode: 'unit', width: 45, vAlign: 'center', hAlign: 'center', formatter: '@'},
|
|
|
],
|
|
|
events: {
|
|
|
SelectionChanging: function (sender, info) {
|
|
|
billsInitSel(info.newSelections[0].row);
|
|
|
},
|
|
|
CellDoubleClick: function (sender, args) {
|
|
|
+ if(!bills.tree){
|
|
|
+ return;
|
|
|
+ }
|
|
|
let node = bills.tree.items[args.row];
|
|
|
if(!node){
|
|
|
return;
|
|
@@ -119,7 +142,7 @@ const billsGuidance = (function () {
|
|
|
headRowHeight: [40],
|
|
|
defaultRowHeight: 21,
|
|
|
cols: [{
|
|
|
- width: 300,
|
|
|
+ width: 420,
|
|
|
readOnly: false,
|
|
|
head: {
|
|
|
titleNames: ["项目指引"],
|
|
@@ -137,7 +160,7 @@ const billsGuidance = (function () {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- width: 50,
|
|
|
+ width: 35,
|
|
|
readOnly: false,
|
|
|
head: {
|
|
|
titleNames: ["选择"],
|
|
@@ -158,11 +181,11 @@ const billsGuidance = (function () {
|
|
|
},
|
|
|
headers: [
|
|
|
{name: '项目指引', dataCode: 'name', width: 300, vAlign: 'center', hAlign: 'left', formatter: '@'},
|
|
|
- {name: '选择', dataCode: 'select', width: 50, vAlign: 'center', hAlign: 'center', formatter: '@'},
|
|
|
+ {name: '选择', dataCode: 'select', width: 35, vAlign: 'center', hAlign: 'center', formatter: '@'},
|
|
|
],
|
|
|
events: {
|
|
|
EditStarting: function (sender, args) {
|
|
|
- if(guideItem.headers[args.col]['dataCode'] === 'name'){
|
|
|
+ if(!bills.tree || guideItem.headers[args.col]['dataCode'] === 'name'){
|
|
|
args.cancel = true;
|
|
|
}
|
|
|
},
|
|
@@ -172,7 +195,7 @@ const billsGuidance = (function () {
|
|
|
}
|
|
|
},
|
|
|
CellDoubleClick: function (sender, args) {
|
|
|
- if(!bills.tree.selected){
|
|
|
+ if(!bills.tree || !bills.tree.selected){
|
|
|
return;
|
|
|
}
|
|
|
let node = bills.tree.selected.guidance.tree.selected;
|
|
@@ -342,6 +365,9 @@ const billsGuidance = (function () {
|
|
|
//清单表焦点控制
|
|
|
//@param {Number}row @return {void}
|
|
|
function billsInitSel(row){
|
|
|
+ if(!bills.tree){
|
|
|
+ return;
|
|
|
+ }
|
|
|
let guideSheet = guideItem.workBook.getActiveSheet();
|
|
|
cleanData(guideSheet, guideItem.headers, -1);
|
|
|
let node = bills.tree.items[row];
|
|
@@ -407,6 +433,9 @@ const billsGuidance = (function () {
|
|
|
//@param {Array}libDats @return {void}
|
|
|
function initLibs(libDatas){
|
|
|
libSel.empty();
|
|
|
+ if(!libDatas){
|
|
|
+ return;
|
|
|
+ }
|
|
|
let selectedLib = sessionStorage.getItem('stdBillsGuidance');
|
|
|
for(let libData of libDatas){
|
|
|
let opt = $('<option>').val(libData.id).text(libData.name);
|
|
@@ -421,6 +450,12 @@ const billsGuidance = (function () {
|
|
|
//初始化视图
|
|
|
//@param {void} @return {void}
|
|
|
function initViews(){
|
|
|
+ //赋初始高度
|
|
|
+ if($('#billsGuidance_bills').height() === 0 || $('#billsGuidance_items').height() === 0){
|
|
|
+ let height = $(window).height()-$(".header").height()-$(".toolsbar").height()-$(".tools-bar-height-z").height();
|
|
|
+ $('#billsGuidance_bills').height(height / 2);
|
|
|
+ $('#billsGuidance_items').height(height / 2);
|
|
|
+ }
|
|
|
let modules = [bills, guideItem];
|
|
|
initWorkBooks(modules);
|
|
|
|
|
@@ -514,7 +549,7 @@ const billsGuidance = (function () {
|
|
|
//插入清单
|
|
|
$('#guidanceInsertBills').click(function () {
|
|
|
//插入清单
|
|
|
- if(!bills.tree.selected){
|
|
|
+ if(!bills.tree || !bills.tree.selected){
|
|
|
return;
|
|
|
}
|
|
|
if(bills.tree.selected.children.length === 0){
|
|
@@ -528,6 +563,9 @@ const billsGuidance = (function () {
|
|
|
});
|
|
|
//搜索
|
|
|
$('#stdBillsGuidanceSearch>span>button').click(function () {
|
|
|
+ if(!bills.tree){
|
|
|
+ return;
|
|
|
+ }
|
|
|
let billsSheet = bills.workBook.getActiveSheet();
|
|
|
billsLibObj.clearHighLight(bills.workBook);
|
|
|
let keyword = $('#stdBillsGuidanceSearch>input').val();
|
|
@@ -582,6 +620,13 @@ const billsGuidance = (function () {
|
|
|
$('#billsGuidanceSearchResultCount').text('搜索结果:' + result.length);
|
|
|
$('#billsGuidanceSearchResult').show();
|
|
|
});
|
|
|
+ //搜索框回车
|
|
|
+ $('#stdBillsGuidanceSearch>input').bind('keypress', function (event) {
|
|
|
+ if(event.keyCode === 13){
|
|
|
+ $(this).blur();
|
|
|
+ $('#stdBillsGuidanceSearch>span>button').click();
|
|
|
+ }
|
|
|
+ });
|
|
|
// 关闭搜索结果
|
|
|
$('#closeSearchBillsGuidance').click(function () {
|
|
|
$('#billsGuidanceSearchResult').hide();
|