|
@@ -443,6 +443,7 @@ const billsGuidance = (function () {
|
|
|
//全部设为无效
|
|
|
$('.tools-btn').children().addClass('disabled');
|
|
|
$('#insertRation').addClass('disabled');
|
|
|
+ $('#insertAll').addClass('disabled');
|
|
|
$('.main-bottom-content').find('textarea').attr('readonly', true);
|
|
|
//插入
|
|
|
if(bills.tree.selected && bills.tree.selected.guidance.tree){
|
|
@@ -484,6 +485,7 @@ const billsGuidance = (function () {
|
|
|
//插入定额
|
|
|
if(node && (node.children.length === 0 || allRationChildren(node))){
|
|
|
$('#insertRation').removeClass('disabled');
|
|
|
+ $('#insertAll').removeClass('disabled');
|
|
|
}
|
|
|
//备注,奇数节点可用
|
|
|
if(node && (node.depth() + 1) % 2 === 1 && node.data.type !== itemType.ration){
|
|
@@ -1135,10 +1137,15 @@ const billsGuidance = (function () {
|
|
|
}
|
|
|
//获取选中的定额表行
|
|
|
//@return {Array}
|
|
|
- function getCheckedRationRows(){
|
|
|
+ function getCheckedRationRows(all){
|
|
|
let rst = [];
|
|
|
let sheet = ration.workBook.getActiveSheet();
|
|
|
for(let i = 0; i < sheet.getRowCount(); i++){
|
|
|
+ // 全选
|
|
|
+ if (all) {
|
|
|
+ rst.push(i);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
let checked = sheet.getValue(i, 0);
|
|
|
if(checked){
|
|
|
rst.push(i);
|
|
@@ -1485,6 +1492,15 @@ const billsGuidance = (function () {
|
|
|
clearCheckedRation(checkedRows);
|
|
|
}
|
|
|
});
|
|
|
+ // 插入全部定额
|
|
|
+ $('#insertAll').click(function () {
|
|
|
+ let isAll = true;
|
|
|
+ let checkedRows = getCheckedRationRows(isAll);
|
|
|
+ let insertDatas = getInsertRations(checkedRows);
|
|
|
+ if(insertDatas.length > 0){
|
|
|
+ insert(insertDatas, false);
|
|
|
+ }
|
|
|
+ });
|
|
|
//搜索定额
|
|
|
$('#searchBtn').click(function () {
|
|
|
let searchStr = $('#searchText').val();
|