Pārlūkot izejas kodu

账号设置,权限设置,全选功能

MaiXinRong 2 mēneši atpakaļ
vecāks
revīzija
ece68dc424

+ 6 - 0
app/public/js/sp_setting_permission.js

@@ -110,6 +110,12 @@ $(document).ready(() => {
             }
         }
     });
+    $('[name=permission-check-all]').click(function() {
+        const ptype = $(this).attr('ptype');
+        const pvalue = $(this).attr('pvalue');
+        $(`[name=permission-check][ptype=${ptype}][pvalue=${pvalue}]`).attr("checked", this.checked);
+        $('#save-permission').show();
+    });
     $('[name=set-permission]').click(function() {
         const data = JSON.parse(this.getAttribute('data-account'));
         const permissionCheck = $('[name="permission-check"]');

+ 2 - 1
app/public/js/spss_gather_stage.js

@@ -153,7 +153,7 @@ $(document).ready(() => {
                 node.sum_qty = node['sum_' + field + '_qty'];
                 node.sum_tp = node['sum_' + field + '_tp'];
                 for (const p of node.pos) {
-                    for (let i = 1; i < billsTree.count; i++) {
+                    for (let i = 1; i <= billsTree.count; i++) {
                         p['show_qty_' + i] = p[field + '_qty_' + i];
                     }
                     p.sum_qty = p['sum_' + field + '_qty'];
@@ -206,6 +206,7 @@ $(document).ready(() => {
         loadCurPosData: function () {
             const node = SpreadJsObj.getSelectObject(billsSheet);
             if (node) {
+                console.log(node.pos);
                 SpreadJsObj.loadSheetData(posSheet, 'data', node.pos || []);
             } else {
                 SpreadJsObj.loadSheetData(posSheet, 'data', []);

+ 1 - 1
app/view/sp_setting/permission.ejs

@@ -74,7 +74,7 @@
                                                 <th width="240px">公司</th>
                                                 <th width="150px">职位</th>
                                                 <% for (const key in permissionConst) { %>
-                                                <th><%- permissionConst[key].title %></th>
+                                                <th><%- permissionConst[key].title %><input class="ml-1 form-check-input" type="checkbox" name="permission-check-all" ptype="<%- ptype %>" pvalue="<%- permissionConst[key].value %>"></th>
                                                 <% } %>
                                             </tr>
                                             </thead>