|
@@ -1673,6 +1673,32 @@ $(document).ready(() => {
|
|
|
// 防止ctrl+z撤销数据
|
|
|
changeSpreadObj.reloadRow(info.sheet, info.row);
|
|
|
};
|
|
|
+ changeSpreadObj.setAllValuation = function (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;
|
|
|
+ }
|
|
|
+ const realNeedChangeList = [];
|
|
|
+ for (const nc of needChangeList) {
|
|
|
+ if (_.findIndex(changeUsedData, { cbid: nc.id }) === -1) {
|
|
|
+ realNeedChangeList.push(nc.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (realNeedChangeList.length === 0) {
|
|
|
+ toastr.warning('全部清单已设置清单'+ (is_valuation ? '' : '不') +'计价');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ postData(window.location.pathname + '/save', { type:'set_all_valuation', ids: realNeedChangeList, is_valuation }, function (result) {
|
|
|
+ changeList = result;
|
|
|
+ const [newChangeList, updateOrderList] = changeSpreadObj.makeNewChangeList();
|
|
|
+ changeSpreadObj.reloadSheet(newChangeList);
|
|
|
+ });
|
|
|
+ };
|
|
|
changeSpreadObj.deletePress = function (sheet) {
|
|
|
if (!sheet.zh_setting) return;
|
|
|
// 暂时仅支持移除数量
|