Przeglądaj źródła

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

lishihao 2 lat temu
rodzic
commit
87ac5d6526

+ 7 - 4
app/public/js/path_tree.js

@@ -393,6 +393,7 @@ const createNewPathTree = function (type, setting) {
             for (const d of this.datas) {
                 d.filter = defaultValue;
             }
+            const parents = [];
             for (const s of this.select) {
                 const node = this.getItems(s);
                 if (!node) continue;
@@ -401,10 +402,12 @@ const createNewPathTree = function (type, setting) {
                 for (const p of posterity) {
                     p.filter = !defaultValue;
                 }
-                const parents = this.getAllParents(node);
-                for (const p of parents) {
-                    p.filter = !defaultValue;
-                }
+                parents.push(...this.getAllParents(node));
+            }
+            parents.sort((x, y) => { return y.level - x.level});
+            for (const parent of parents) {
+                parent.filter = !parent.children.find(x => { return !x.filter });
+
             }
             for (const node of this.nodes) {
                 const parent = this.getParent(node);

+ 7 - 18
app/public/js/revise_price.js

@@ -209,7 +209,7 @@ $(document).ready(() => {
                 const choose = price.rela_cid.split(',');
                 for (const c of this.change) {
                     c.rela = choose.indexOf(c.cid + '') >= 0;
-                    c.valid = c.rela;
+                    c.valid = !!c.rela;
                 }
             } else {
                 const invalid = [];
@@ -225,14 +225,17 @@ $(document).ready(() => {
                         const exist = c.bills.find(x => {
                             return x.code === price.b_code && x.name === price.name && x.unit === price.unit && x.unit_price === price.org_price;
                         });
-                        c.valid = exist;
+                        c.valid = !!exist;
                     }
                 }
             }
             this.relaChange.length = 0;
 
             for (const c of this.change) {
-                if (c.valid) this.relaChange.push(c);
+                if (c.valid){
+                    this.relaChange.push(c);
+                    c.visible = true;
+                }
             }
         }
         refreshRela(price) {
@@ -528,21 +531,6 @@ $(document).ready(() => {
                         return !readOnly;
                     }
                 },
-                noRelaBw: {
-                    name: '不应用于任何部位',
-                    icon: 'fa-unlink',
-                    callback: function (key, opt) {
-                        const price = SpreadJsObj.getSelectObject(priceSheet);
-                        priceOprObj.updateRelaLid(price, '-1');
-                    },
-                    disabled: function (key, opt) {
-                        const node = SpreadJsObj.getSelectObject(priceSheet);
-                        return !node;
-                    },
-                    visible: function (key, opt) {
-                        return !readOnly;
-                    }
-                },
                 chooseRelaChange: {
                     name: '选择应用变更令',
                     icon: 'fa-link',
@@ -972,6 +960,7 @@ $(document).ready(() => {
                 this.invalid.push(...cid);
             }
             for (const c of this.change) {
+                c.visible = true;
                 c.check = this.choose.indexOf(c.cid + '') >= 0;
                 c.invalid = this.invalid.indexOf(c.cid + '') >= 0;
                 if (!c.check && !c.invalid) {

+ 0 - 10
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -1190,16 +1190,6 @@ const SpreadJsObj = {
                 sheet.setRowVisible(iRow, true);
             }
         }
-        // if (sheet.zh_tree) {
-        //     for (const iRow in sheet.zh_tree.nodes) {
-        //         const node = sheet.zh_tree.nodes[iRow];
-        //         if (node.visible !== undefined && node.visible !== null) {
-        //             sheet.setRowVisible(iRow, node.visible);
-        //         } else {
-        //             sheet.setRowVisible(iRow, true);
-        //         }
-        //     }
-        // }
         this.endMassOperation(sheet);
     },
     refreshColumnAlign: function (sheet) {

+ 4 - 4
app/service/stage_audit_ass.js

@@ -97,12 +97,12 @@ module.exports = app => {
                 x.locked_ledger_id = x.ass_ledger_id.split(',');
             });
             // 审批人数据锁定
-            const locking = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid } });
+            const locking = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid, confirm: 1 } });
             if (locking.length > 0) {
                 const updateLock = locking.map(x => { return { id: x.id, locked: 1 }; });
                 await transaction.updateRows(this.tableName, updateLock);
             }
-            const preConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: pre_uid } });
+            const preConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: pre_uid, confirm: 1 } });
             // 前审批人数据,与被锁定数据相关数据确认状态保留
             locked.push(...locking);
             if (preConfirm.length > 0) {
@@ -125,7 +125,7 @@ module.exports = app => {
         async lockConfirm4CheckNo(stage, uid, auditors, transaction) {
             if (!transaction) throw '缺少参数';
             // 审批人数据锁定
-            const lockConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid } });
+            const lockConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid, confirm: 1 } });
             if (lockConfirm.length === 0) return;
 
             const insertData = [];
@@ -141,7 +141,7 @@ module.exports = app => {
                 if (a.aid === uid) break;
                 keepUid.push(a.aid);
             }
-            const keepConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: keepUid } });
+            const keepConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: keepUid, confirm: 1 } });
             for (const kc of keepConfirm) {
                 const bills = await this.ctx.service.ledger.getDataByCondition({ tender_id: stage.tid, ledger_id: kc.ledger_id });
                 const billsOwner = bills ? bills.full_path.split('-') : [];

+ 1 - 1
app/view/stage/index.ejs

@@ -527,7 +527,7 @@
         regExp = new RegExp(FindText, 'g');
         return this.replace(regExp, RepText);
     }
-    const readOnly = <%- stage.readOnly || stage.revising || (!!stage.assist && !stage.assist.confirm) %>;
+    const readOnly = <%- stage.readOnly || stage.revising || (!stage.assist || !!stage.assist.confirm) %>;
     const ledgerSpreadSetting = JSON.parse('<%- JSON.stringify(ledgerSpread) %>');
     ledgerSpreadSetting.localCache = {
         key: 'stage-bills',