m0_70156489 1 nedēļu atpakaļ
vecāks
revīzija
7012ea5f8d

+ 4 - 1
application/admin/controller/Procuremen.php

@@ -236,7 +236,7 @@ class Procuremen extends Backend
             'purchaseconfirmpick'     => $this->hasProcuremenPerm(['purchaseconfirmpick', 'purchaseConfirmPick']),
             'purchaseconfirmpick'     => $this->hasProcuremenPerm(['purchaseconfirmpick', 'purchaseConfirmPick']),
             'purchaseapprovalreject'  => $this->hasProcuremenPerm(['purchaseapprovalreject', 'purchaseApprovalReject']),
             'purchaseapprovalreject'  => $this->hasProcuremenPerm(['purchaseapprovalreject', 'purchaseApprovalReject']),
             'details'                 => $this->hasProcuremenPerm(['details']),
             'details'                 => $this->hasProcuremenPerm(['details']),
-            'archiveabandon'          => $this->hasProcuremenPerm(['archiveabandon']),
+            'archiveabandon'          => $this->hasProcuremenPerm(['archiveabandon', 'archiveAbandon', 'auditabandon', 'auditAbandon']),
             'export_month_outward'    => $this->hasProcuremenPerm(['export_month_outward', 'exportMonthOutward']),
             'export_month_outward'    => $this->hasProcuremenPerm(['export_month_outward', 'exportMonthOutward']),
             'review'                  => $this->hasProcuremenPerm(['review', 'picksubmit', 'pickreview']),
             'review'                  => $this->hasProcuremenPerm(['review', 'picksubmit', 'pickreview']),
             'reviewcompanies'         => $this->hasProcuremenPerm(['reviewcompanies', 'reviewCompanies', 'pickreview', 'picksubmit', 'review']),
             'reviewcompanies'         => $this->hasProcuremenPerm(['reviewcompanies', 'reviewCompanies', 'pickreview', 'picksubmit', 'review']),
@@ -6708,6 +6708,9 @@ class Procuremen extends Backend
         if (!$this->request->isPost()) {
         if (!$this->request->isPost()) {
             $this->error(__('Invalid parameters'));
             $this->error(__('Invalid parameters'));
         }
         }
+        if (!$this->hasProcuremenPerm(['archiveabandon', 'archiveAbandon', 'auditabandon', 'auditAbandon'])) {
+            $this->error(__('You have no permission'));
+        }
 
 
         $anchorIds = [];
         $anchorIds = [];
         $batchRaw = trim((string)$this->request->post('scydgy_ids_json', ''));
         $batchRaw = trim((string)$this->request->post('scydgy_ids_json', ''));

+ 63 - 2
application/admin/controller/Procuremenarchive.php

@@ -19,12 +19,73 @@ class Procuremenarchive extends Backend
     public function _initialize()
     public function _initialize()
     {
     {
         parent::_initialize();
         parent::_initialize();
+        $canArchiveAbandon = $this->canArchiveAbandon();
+        $canDetails = $this->hasProcuremenSiblingPerm(['details']);
+        $this->view->assign('canArchiveAbandon', $canArchiveAbandon);
         $this->assignconfig('procuremenAuth', [
         $this->assignconfig('procuremenAuth', [
-            'details'        => $this->auth->check('procuremen/details'),
-            'archiveabandon' => $this->auth->check('procuremen/archiveabandon'),
+            'details'        => $canDetails,
+            'archiveabandon' => $canArchiveAbandon,
         ]);
         ]);
     }
     }
 
 
+    /**
+     * 历史存证「重新下发」权限(规则名在 procuremen 控制器下)
+     */
+    protected function canArchiveAbandon(): bool
+    {
+        if ($this->hasProcuremenSiblingPerm(['archiveabandon', 'archiveAbandon'])) {
+            return true;
+        }
+
+        return $this->hasProcuremenSiblingPerm(['auditabandon', 'auditAbandon']);
+    }
+
+    /**
+     * @param string[] $actions
+     */
+    protected function hasProcuremenSiblingPerm(array $actions): bool
+    {
+        foreach ($actions as $action) {
+            $action = strtolower(trim((string)$action));
+            if ($action === '') {
+                continue;
+            }
+            if (strpos($action, 'procuremen/') !== 0) {
+                $action = 'procuremen/' . $action;
+            }
+            if ($this->auth->check($action)) {
+                return true;
+            }
+        }
+        $suffixes = [];
+        foreach ($actions as $action) {
+            $action = strtolower(trim((string)$action));
+            $action = preg_replace('#^procuremen/#', '', $action);
+            if ($action !== '') {
+                $suffixes[$action] = true;
+            }
+        }
+        if ($suffixes === []) {
+            return false;
+        }
+        try {
+            foreach ($this->auth->getRuleList() as $rule) {
+                $rule = strtolower((string)$rule);
+                if (strpos($rule, 'procuremen/') !== 0) {
+                    continue;
+                }
+                foreach (array_keys($suffixes) as $suffix) {
+                    if ($rule === 'procuremen/' . $suffix || strpos($rule, 'procuremen/' . $suffix . '/') === 0) {
+                        return true;
+                    }
+                }
+            }
+        } catch (\Throwable $e) {
+        }
+
+        return false;
+    }
+
     /** purchase_order.status 为已完结(兼容 varchar / 数字 / 首尾空格) */
     /** purchase_order.status 为已完结(兼容 varchar / 数字 / 首尾空格) */
     protected function applyPurchaseOrderCompletedWhere($query): void
     protected function applyPurchaseOrderCompletedWhere($query): void
     {
     {

+ 31 - 0
application/admin/controller/Procuremenmenu.php

@@ -154,6 +154,37 @@ class Procuremenmenu extends Backend
                     $added++;
                     $added++;
                 }
                 }
             }
             }
+            if ($m['name'] === 'procuremenarchive/index') {
+                $archiveChildren = [
+                    ['name' => 'procuremen/archiveabandon', 'title' => '重新下发'],
+                    ['name' => 'procuremen/details', 'title' => '详情'],
+                ];
+                foreach ($archiveChildren as $cr) {
+                    $exists = Db::name('auth_rule')->where('name', $cr['name'])->find();
+                    if ($exists) {
+                        Db::name('auth_rule')->where('name', $cr['name'])->update([
+                            'pid'        => $menuId,
+                            'title'      => $cr['title'],
+                            'status'     => 'normal',
+                            'ismenu'     => 0,
+                            'updatetime' => $t,
+                        ]);
+                        continue;
+                    }
+                    Db::name('auth_rule')->insert([
+                        'type'       => 'file',
+                        'pid'        => $menuId,
+                        'name'       => $cr['name'],
+                        'title'      => $cr['title'],
+                        'icon'       => 'fa fa-circle-o',
+                        'ismenu'     => 0,
+                        'status'     => 'normal',
+                        'createtime' => $t,
+                        'updatetime' => $t,
+                    ]);
+                    $added++;
+                }
+            }
         }
         }
         \think\Cache::rm('__menu__');
         \think\Cache::rm('__menu__');
         $this->success('菜单安装完成,新增节点 ' . $added . ' 个。请刷新后台并到「权限管理」为角色勾选新菜单。');
         $this->success('菜单安装完成,新增节点 ' . $added . ' 个。请刷新后台并到「权限管理」为角色勾选新菜单。');

+ 1 - 1
application/admin/view/common/menu.html

@@ -3,7 +3,7 @@
     <!-- 管理员信息 -->
     <!-- 管理员信息 -->
     <div class="user-panel hidden-xs">
     <div class="user-panel hidden-xs">
         <div class="pull-left image">
         <div class="pull-left image">
-            <a href="general/profile" class="addtabsit"><img src="{$admin.avatar|cdnurl|htmlentities}" class="img-circle" /></a>
+            <img src="{$admin.avatar|cdnurl|htmlentities}" class="img-circle" alt="" />
         </div>
         </div>
         <div class="pull-left info">
         <div class="pull-left info">
             <p>{$admin.nickname|htmlentities}</p>
             <p>{$admin.nickname|htmlentities}</p>

+ 35 - 12
application/admin/view/index/login.html

@@ -12,12 +12,14 @@
             height: 100%;
             height: 100%;
             margin: 0;
             margin: 0;
             padding: 0;
             padding: 0;
+            overflow: hidden;
         }
         }
 
 
         body.login-page {
         body.login-page {
+            height: 100vh;
             min-height: 100vh;
             min-height: 100vh;
-            overflow-x: hidden;
-            overflow-y: auto;
+            max-height: 100vh;
+            overflow: hidden;
             background-color: #020b1e;
             background-color: #020b1e;
             background-image: url('https://a-7in6-com.oss-cn-hangzhou.aliyuncs.com/xinhua/img/login1.png');
             background-image: url('https://a-7in6-com.oss-cn-hangzhou.aliyuncs.com/xinhua/img/login1.png');
             background-repeat: no-repeat;
             background-repeat: no-repeat;
@@ -50,14 +52,16 @@
             position: relative;
             position: relative;
             z-index: 2;
             z-index: 2;
             display: flex;
             display: flex;
-            align-items: flex-start;
+            align-items: center;
             justify-content: space-between;
             justify-content: space-between;
-            gap: clamp(8px, 2vw, 28px);
+            gap: clamp(16px, 2.5vw, 40px);
             width: 100%;
             width: 100%;
-            /* max-width: 1678px; */
+            max-width: 1760px;
             margin: 0 auto;
             margin: 0 auto;
-            /* padding: 6px 7% 90px 3%; */
-            min-height: auto;
+            min-height: calc(100vh - 76px);
+            max-height: calc(100vh - 76px);
+            padding: 0 clamp(32px, 4vw, 72px) 48px;
+            overflow: hidden;
         }
         }
 
 
         .login-visual {
         .login-visual {
@@ -72,11 +76,13 @@
         .login-visual-art {
         .login-visual-art {
             display: block;
             display: block;
             flex-shrink: 0;
             flex-shrink: 0;
-            height: calc(106vh - 85px);
+            height: calc(100vh - 105px);
+            max-height: calc(100vh - 105px);
             aspect-ratio: 16 / 9;
             aspect-ratio: 16 / 9;
             width: auto;
             width: auto;
-            max-width: min(calc((106vh - 85px) * 16 / 9), 78vw);
-            margin-left: clamp(32px, 4vw, 72px);
+            max-width: min(calc((100vh - 105px) * 16 / 9), calc(100vw - 500px));
+            min-width: 360px;
+            min-height: 260px;
             background: url('https://a-7in6-com.oss-cn-hangzhou.aliyuncs.com/xinhua/img/login3.png') no-repeat center center;
             background: url('https://a-7in6-com.oss-cn-hangzhou.aliyuncs.com/xinhua/img/login3.png') no-repeat center center;
             background-size: contain;
             background-size: contain;
             pointer-events: none;
             pointer-events: none;
@@ -88,8 +94,8 @@
             width: 100%;
             width: 100%;
             max-width: 400px;
             max-width: 400px;
             min-width: 300px;
             min-width: 300px;
-            margin-left: auto;
-            margin-right: clamp(56px, 9vw, 150px);
+            margin-left: 0;
+            margin-right: clamp(24px, 4vw, 64px);
             padding: 0;
             padding: 0;
             align-self: center;
             align-self: center;
             transform: translateY(0);
             transform: translateY(0);
@@ -257,17 +263,34 @@
         }
         }
 
 
         @media (max-width: 1100px) {
         @media (max-width: 1100px) {
+            html, body {
+                overflow-x: hidden;
+                overflow-y: auto;
+            }
+
+            body.login-page {
+                height: auto;
+                min-height: 100vh;
+                max-height: none;
+                overflow-x: hidden;
+                overflow-y: auto;
+            }
+
             .login-main {
             .login-main {
                 flex-direction: column;
                 flex-direction: column;
                 justify-content: flex-start;
                 justify-content: flex-start;
+                align-items: center;
                 padding: 16px 24px 96px;
                 padding: 16px 24px 96px;
                 min-height: auto;
                 min-height: auto;
+                max-height: none;
+                overflow: visible;
             }
             }
 
 
             .login-visual {
             .login-visual {
                 flex: 0 0 auto;
                 flex: 0 0 auto;
                 width: 100%;
                 width: 100%;
                 justify-content: center;
                 justify-content: center;
+                overflow: visible;
             }
             }
 
 
             .login-visual-art {
             .login-visual-art {

+ 1 - 1
application/admin/view/procuremenarchive/index.html

@@ -5,7 +5,7 @@
         <div class="widget-body no-padding">
         <div class="widget-body no-padding">
             <div id="toolbar" class="toolbar">
             <div id="toolbar" class="toolbar">
                 {:build_toolbar('refresh')}
                 {:build_toolbar('refresh')}
-                {if $auth->check('procuremen/archiveabandon')}
+                {if $canArchiveAbandon}
                 <a href="javascript:;" class="btn btn-danger" id="btn-archive-abandon" title="勾选一条或多条已完结订单退回协助初选重新下发"><i class="fa fa-repeat"></i> 重新下发</a>
                 <a href="javascript:;" class="btn btn-danger" id="btn-archive-abandon" title="勾选一条或多条已完结订单退回协助初选重新下发"><i class="fa fa-repeat"></i> 重新下发</a>
                 {/if}
                 {/if}
             </div>
             </div>

+ 21 - 1
public/assets/css/backend.css

@@ -517,12 +517,27 @@ input.selectpage {
 form.form-horizontal .control-label {
 form.form-horizontal .control-label {
   font-weight: normal;
   font-weight: normal;
 }
 }
+.user-panel > .image {
+  width: 45px;
+  height: 45px;
+  overflow: hidden;
+  border-radius: 50%;
+  cursor: default;
+  pointer-events: none;
+}
 .user-panel > .image img {
 .user-panel > .image img {
+  display: block;
   width: 45px;
   width: 45px;
   height: 45px;
   height: 45px;
+  max-width: 45px;
+  object-fit: cover;
+  object-position: center;
+}
+.user-panel > .info {
+  cursor: default;
+  pointer-events: none;
 }
 }
 /*panel扩展描述样式*/
 /*panel扩展描述样式*/
-.panel-intro {
   margin-bottom: 0;
   margin-bottom: 0;
   border: none;
   border: none;
 }
 }
@@ -865,9 +880,14 @@ form.form-horizontal .control-label {
 .sidebar-menu > li .badge {
 .sidebar-menu > li .badge {
   margin-top: 0;
   margin-top: 0;
 }
 }
+.sidebar-collapse .user-panel > .image {
+  width: 25px;
+  height: 25px;
+}
 .sidebar-collapse .user-panel > .image img {
 .sidebar-collapse .user-panel > .image img {
   width: 25px;
   width: 25px;
   height: 25px;
   height: 25px;
+  max-width: 25px;
 }
 }
 @media (min-width: 768px) {
 @media (min-width: 768px) {
   .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container {
   .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
public/assets/css/backend.min.css


+ 4 - 0
public/assets/js/backend/procuremenarchive.js

@@ -145,6 +145,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
 
             $(document).off('click.procuremenArchiveAbandon', '#btn-archive-abandon').on('click.procuremenArchiveAbandon', '#btn-archive-abandon', function (e) {
             $(document).off('click.procuremenArchiveAbandon', '#btn-archive-abandon').on('click.procuremenArchiveAbandon', '#btn-archive-abandon', function (e) {
                 e.preventDefault();
                 e.preventDefault();
+                if (!archiveCan('archiveabandon')) {
+                    Toastr.error('无重新下发权限');
+                    return;
+                }
                 var sel = table.bootstrapTable('getSelections') || [];
                 var sel = table.bootstrapTable('getSelections') || [];
                 if (!sel.length) {
                 if (!sel.length) {
                     Toastr.warning('请先勾选至少 1 条订单');
                     Toastr.warning('请先勾选至少 1 条订单');

+ 26 - 2
public/assets/less/backend.less

@@ -339,9 +339,27 @@ form.form-horizontal .control-label {
     font-weight: normal;
     font-weight: normal;
 }
 }
 
 
-.user-panel > .image img {
+.user-panel > .image {
     width: 45px;
     width: 45px;
     height: 45px;
     height: 45px;
+    overflow: hidden;
+    border-radius: 50%;
+    cursor: default;
+    pointer-events: none;
+
+    img {
+        display: block;
+        width: 45px;
+        height: 45px;
+        max-width: 45px;
+        object-fit: cover;
+        object-position: center;
+    }
+}
+
+.user-panel > .info {
+    cursor: default;
+    pointer-events: none;
 }
 }
 
 
 /*panel扩展描述样式*/
 /*panel扩展描述样式*/
@@ -768,9 +786,15 @@ form.form-horizontal .control-label {
 }
 }
 
 
 .sidebar-collapse {
 .sidebar-collapse {
-    .user-panel > .image img {
+    .user-panel > .image {
         width: 25px;
         width: 25px;
         height: 25px;
         height: 25px;
+
+        img {
+            width: 25px;
+            height: 25px;
+            max-width: 25px;
+        }
     }
     }
 }
 }
 
 

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels