|
@@ -757,6 +757,23 @@ $(document).ready(() => {
|
|
|
// 防止ctrl+z撤销数据
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
},
|
|
|
+ setAllValuation(is_valuation) {
|
|
|
+ if (changeList.length === 0) {
|
|
|
+ toastr.warning('暂无清单无法设置清单计价');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const needChangeList = _.filter(changeList, { is_valuation: is_valuation ? 0 : 1 });
|
|
|
+ if (needChangeList.length === 0) {
|
|
|
+ toastr.warning('全部清单已设置清单'+ (is_valuation ? '' : '不') +'计价');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ postData(window.location.pathname + '/save', { type:'set_all_valuation', is_valuation }, function (result) {
|
|
|
+ changeList = result;
|
|
|
+ SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
|
|
|
+ changeSpreadObj.makeSjsFooter();
|
|
|
+ changeSpreadObj.resetXmjSpread(SpreadJsObj.getSelectObject(changeSpreadSheet));
|
|
|
+ });
|
|
|
+ },
|
|
|
_checkExprValid(expr) {
|
|
|
if (!expr) return [true, null];
|
|
|
const param = [];
|
|
@@ -1237,6 +1254,22 @@ $(document).ready(() => {
|
|
|
return isUsed;
|
|
|
}
|
|
|
},
|
|
|
+ sprEdit: '----',
|
|
|
+ 'allNotValuation': {
|
|
|
+ name: '设置全部清单不计价',
|
|
|
+ icon: 'fa-magic',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ changeSpreadObj.setAllValuation(0);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ 'allValuation': {
|
|
|
+ name: '设置全部清单计价',
|
|
|
+ icon: 'fa-magic',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ changeSpreadObj.setAllValuation(1);
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|