MaiXinRong 2 роки тому
батько
коміт
10fb7f0036
2 змінених файлів з 68 додано та 70 видалено
  1. 67 67
      app/public/js/stage.js
  2. 1 3
      app/view/layout/layout.ejs

+ 67 - 67
app/public/js/stage.js

@@ -3900,39 +3900,39 @@ $(document).ready(() => {
                             return !changeBills;
                         }
                     },
-                    'autoUse': {
-                        name: '调用',
-                        icon: 'fa-play',
-                        callback: function (key, opt) {
-                            const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
-                            const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
-                            const billsPos = self.findBillsPos(curChange, changeBills);
-                            if (!billsPos) toastr.warning('无可调用的清单或计量单元');
-
-                            const data = { autoType: 'bills', bills: [{ ...billsPos, cid: changeBills.cid, cbid: changeBills.cbid }] };
-                            postData(window.location.pathname + '/auto-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)
-                                }
-                            });
-                        },
-                        disable: function (key, opt) {
-                            const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
-                            const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
-                            return !changeBills || curChange.is_import;
-                        },
-                        visible: function (key, opt) {
-                            return is_debug && stage.status === 1;
-                        }
-                    },
+                    // 'autoUse': {
+                    //     name: '调用',
+                    //     icon: 'fa-play',
+                    //     callback: function (key, opt) {
+                    //         const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
+                    //         const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
+                    //         const billsPos = self.findBillsPos(curChange, changeBills);
+                    //         if (!billsPos) toastr.warning('无可调用的清单或计量单元');
+                    //
+                    //         const data = { autoType: 'bills', bills: [{ ...billsPos, cid: changeBills.cid, cbid: changeBills.cbid }] };
+                    //         postData(window.location.pathname + '/auto-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)
+                    //             }
+                    //         });
+                    //     },
+                    //     disable: function (key, opt) {
+                    //         const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
+                    //         const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
+                    //         return !changeBills || curChange.is_import;
+                    //     },
+                    //     visible: function (key, opt) {
+                    //         return is_debug && stage.status === 1;
+                    //     }
+                    // },
                 }
             });
 
@@ -3943,40 +3943,40 @@ $(document).ready(() => {
                     return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
                 },
                 items: {
-                    'autoUseCur': {
-                        name: '自动调用',
-                        icon: 'fa-play',
-                        callback: function (key, opt) {
-                            const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
-                            const changeBills = SpreadJsObj.zh_data;
-                            const data = { bills: [], autoType: 'bills' };
-                            for (const cb of changeBills) {
-                                const billsPos = self.findBillsPos(curChange, cb);
-                                if (billsPos) data.push({ ...billsPos, cid: curChange.cid, cbid: cb.cbid })
-                            }
-                            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)
-                                }
-                            });
-                        },
-                        disable: function (key, opt) {
-                            const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
-                            const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
-                            return !changeBills || curChange.is_import;
-                        },
-                        visible: function (key, opt) {
-                            return is_debug && stage.status === 1;
-                        }
-                    },
+                    // 'autoUseCur': {
+                    //     name: '自动调用',
+                    //     icon: 'fa-play',
+                    //     callback: function (key, opt) {
+                    //         const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
+                    //         const changeBills = SpreadJsObj.zh_data;
+                    //         const data = { bills: [], autoType: 'bills' };
+                    //         for (const cb of changeBills) {
+                    //             const billsPos = self.findBillsPos(curChange, cb);
+                    //             if (billsPos) data.push({ ...billsPos, cid: curChange.cid, cbid: cb.cbid })
+                    //         }
+                    //         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)
+                    //             }
+                    //         });
+                    //     },
+                    //     disable: function (key, opt) {
+                    //         const curChange = SpreadJsObj.getSelectObject(self.changeSheet);
+                    //         const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
+                    //         return !changeBills || curChange.is_import;
+                    //     },
+                    //     visible: function (key, opt) {
+                    //         return is_debug && stage.status === 1;
+                    //     }
+                    // },
                     'autoUseAll': {
                         name: '自动调用(全部变更令)',
                         icon: 'fa-play',

+ 1 - 3
app/view/layout/layout.ejs

@@ -79,9 +79,7 @@
     }
     const userID = <%- ctx.session.sessionUser.accountId %>;
     let user = '<%= ctx.session.sessionUser.name %>';
-    <% if (ctx.session.sessionUser.loginStatus) { %>
-    const is_debug = true;
-    <% } %>
+    const is_debug = ctx.session.sessionUser.loginStatus ? true : false;
 </script>
 <style type="text/css">