|
@@ -81,18 +81,21 @@ $(document).ready(function() {
|
|
|
const tree = sheet.zh_tree;
|
|
|
if (!tree) { return; }
|
|
|
const node = sheet.zh_tree.nodes[row];
|
|
|
+ const preNode = tree.getPreSiblingNode(node);
|
|
|
const valid = !sheet.zh_setting.readOnly;
|
|
|
|
|
|
setObjEnable($('#delete'), valid && node);
|
|
|
- setObjEnable($('#up-move'), valid && node && node.order > 1);
|
|
|
+ setObjEnable($('#up-move'), valid && node && preNode);
|
|
|
setObjEnable($('#down-move'), valid && node && !tree.isLastSibling(node));
|
|
|
if (checkTzMeasureType()) {
|
|
|
const posRange = node ? pos.getLedgerPos(node.id) : [];
|
|
|
setObjEnable($('#up-level'), valid && node && tree.getParent(node) && node.level > 2 && (!posRange || posRange.length === 0));
|
|
|
+ const preNodePosRange = preNode ? pos.getLedgerPos(preNode.id) : [];
|
|
|
+ setObjEnable($('#down-level'), valid && node && preNode && (!preNodePosRange || preNodePosRange.length === 0));
|
|
|
} else {
|
|
|
setObjEnable($('#up-level'), valid && node && tree.getParent(node));
|
|
|
+ setObjEnable($('#down-level'), valid && node && preNode);
|
|
|
}
|
|
|
- setObjEnable($('#down-level'), valid && node && node.order > 1);
|
|
|
},
|
|
|
refreshTree: function (sheet, data) {
|
|
|
SpreadJsObj.massOperationSheet(sheet, function () {
|
|
@@ -919,9 +922,9 @@ $(document).ready(function() {
|
|
|
keys: ['id', 'list_id', 'chapter_id'],
|
|
|
}, {
|
|
|
cols: [
|
|
|
- {title: '项目节编号', field: 'code', width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
|
- {title: '名称', field: 'name', width: 230, formatter: '@', readOnly: true},
|
|
|
- {title: '单位', field: 'unit', width: 50, formatter: '@', readOnly: true}
|
|
|
+ {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
|
+ {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
|
|
|
+ {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
|
|
|
],
|
|
|
treeCol: 0,
|
|
|
emptyRows: 0,
|
|
@@ -943,9 +946,9 @@ $(document).ready(function() {
|
|
|
keys: ['id', 'list_id', 'bill_id']
|
|
|
}, {
|
|
|
cols: [
|
|
|
- {title: '清单编号', field: 'code', width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
|
- {title: '名称', field: 'name', width: 230, formatter: '@', readOnly: true},
|
|
|
- {title: '单位', field: 'unit', width: 50, formatter: '@', readOnly: true}
|
|
|
+ {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
|
|
|
+ {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
|
|
|
+ {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
|
|
|
],
|
|
|
treeCol: 0,
|
|
|
emptyRows: 0,
|
|
@@ -960,12 +963,12 @@ $(document).ready(function() {
|
|
|
if (!dealBills) {
|
|
|
dealBills = new DealBills($('#deal-bills-spread')[0], {
|
|
|
cols: [
|
|
|
- {title: '清单编号', field: 'code', width: 120, formatter: '@', readOnly: true},
|
|
|
- {title: '名称', field: 'name', width: 230, formatter: '@', readOnly: true},
|
|
|
- {title: '单位', field: 'unit', width: 50, formatter: '@', readOnly: true},
|
|
|
- {title: '单价', field: 'unit_price', width: 50, readOnly: true},
|
|
|
- {title: '数量', field: 'quantity', width: 50, readOnly: true},
|
|
|
- {title: '金额', field: 'total_price', width: 50, readOnly: true},
|
|
|
+ {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
|
|
|
+ {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
|
|
|
+ {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
|
|
|
+ {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
|
|
|
+ {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
|
|
|
+ {title: '金额', field: 'total_price', hAlign: 2, width: 50, readOnly: true},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 1,
|
|
@@ -979,12 +982,12 @@ $(document).ready(function() {
|
|
|
if (!searchLedger) {
|
|
|
searchLedger = new SearchLedger($('#search'), {
|
|
|
cols: [
|
|
|
- {title: '项目节编号', field: 'code', width: 120, formatter: '@', readOnly: true},
|
|
|
- {title: '清单编号', field: 'b_code', width: 120, formatter: '@', readOnly: true},
|
|
|
- {title: '名称', field: 'name', width: 230, formatter: '@', readOnly: true},
|
|
|
- {title: '单位', field: 'unit', width: 50, formatter: '@', readOnly: true},
|
|
|
- {title: '单价', field: 'unit_price', width: 50, readOnly: true},
|
|
|
- {title: '数量', field: 'quantity', width: 50, readOnly: true},
|
|
|
+ {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
|
|
|
+ {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
|
|
|
+ {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
|
|
|
+ {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
|
|
|
+ {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
|
|
|
+ {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
|
|
|
],
|
|
|
emptyRows: 3,
|
|
|
headRows: 1,
|