|
|
@@ -4586,30 +4586,32 @@ $(document).ready(() => {
|
|
|
name: '自动调用',
|
|
|
icon: 'fa-play',
|
|
|
callback: function (key, opt) {
|
|
|
- const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
|
|
|
- const changeBills = self.changeBillsSheet.zh_data;
|
|
|
- const data = { bills: [], autoType: 'bills' };
|
|
|
- for (const cb of changeBills) {
|
|
|
- const billsPos = self.findBillsPos(curChange, cb);
|
|
|
- if (billsPos) data.bills.push({ ...billsPos, cid: cb.cid, cbid: cb.id })
|
|
|
- }
|
|
|
- if (data.bills.length === 0) {
|
|
|
- toastr.warning('无可调用的清单或计量单元');
|
|
|
- return;
|
|
|
- }
|
|
|
- postData(window.location.pathname + '/auto-use-change', data, function(result) {
|
|
|
- if (result.pos) {
|
|
|
- stagePos.loadCurStageData(result.pos.curStageData);
|
|
|
+ checkAgainHint(function(){
|
|
|
+ const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
|
|
|
+ const changeBills = self.changeBillsSheet.zh_data;
|
|
|
+ const data = { bills: [], autoType: 'bills' };
|
|
|
+ for (const cb of changeBills) {
|
|
|
+ const billsPos = self.findBillsPos(curChange, cb);
|
|
|
+ if (billsPos) data.bills.push({ ...billsPos, cid: cb.cid, cbid: cb.id })
|
|
|
}
|
|
|
- const nodes = stageTree.loadPostStageData(result.bills);
|
|
|
- stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), nodes);
|
|
|
- stagePosSpreadObj.loadCurPosData();
|
|
|
- if (detail) {
|
|
|
- detail.loadStageChangeUpdateData(result, nodes);
|
|
|
- } else {
|
|
|
- stageIm.loadUpdateChangeData(result, nodes)
|
|
|
+ if (data.bills.length === 0) {
|
|
|
+ toastr.warning('无可调用的清单或计量单元');
|
|
|
+ return;
|
|
|
}
|
|
|
- });
|
|
|
+ postData(window.location.pathname + '/auto-use-change', data, function(result) {
|
|
|
+ if (result.pos) {
|
|
|
+ stagePos.loadCurStageData(result.pos.curStageData);
|
|
|
+ }
|
|
|
+ const nodes = stageTree.loadPostStageData(result.bills);
|
|
|
+ stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), nodes);
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
+ if (detail) {
|
|
|
+ detail.loadStageChangeUpdateData(result, nodes);
|
|
|
+ } else {
|
|
|
+ stageIm.loadUpdateChangeData(result, nodes)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, ['自动调用后,已调用变更令无法批量取消,请谨慎操作。', '去顶自动调用变更令?']);
|
|
|
},
|
|
|
disabled: function (key, opt) {
|
|
|
const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
|
|
|
@@ -4624,9 +4626,11 @@ $(document).ready(() => {
|
|
|
name: '自动调用(全部变更令)',
|
|
|
icon: 'fa-play',
|
|
|
callback: function (key, opt) {
|
|
|
- postData(window.location.pathname + '/auto-use-change', { autoType: 'all' }, function(result) {
|
|
|
- window.location.reload();
|
|
|
- });
|
|
|
+ checkAgainHint(function(){
|
|
|
+ postData(window.location.pathname + '/auto-use-change', { autoType: 'all' }, function(result) {
|
|
|
+ window.location.reload();
|
|
|
+ });
|
|
|
+ }, ['自动调用后,已调用变更令无法批量取消,请谨慎操作。', '去顶自动调用变更令?']);
|
|
|
},
|
|
|
disabled: function (key, opt) {
|
|
|
const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
|