m0_70156489 5 dienas atpakaļ
vecāks
revīzija
5da5c07032

+ 125 - 12
application/admin/controller/Procuremen.php

@@ -2385,6 +2385,7 @@ class Procuremen extends Backend
         $quoteVisible = $this->canViewProcuremenSupplierQuotesForBundle($bundle);
         $gymcMap = [];
         $qtyBySid = [];
+        $orderedSids = [];
         foreach ($bundle['merge_rows'] ?? [] as $mr) {
             if (!is_array($mr)) {
                 continue;
@@ -2392,6 +2393,7 @@ class Procuremen extends Backend
             $gid = $this->extractScydgyRowId($mr);
             if ($this->isValidScydgyRowId($gid)) {
                 $gymcMap[$gid] = trim((string)($mr['CGYMC'] ?? ''));
+                $orderedSids[] = $gid;
                 $qty = trim((string)($mr['This_quantity'] ?? ''));
                 if ($qty === '') {
                     $qty = trim((string)($mr['NGZL'] ?? ''));
@@ -2409,6 +2411,9 @@ class Procuremen extends Backend
                 if ($nm !== '') {
                     $gymcMap[$gid] = $nm;
                 }
+                if (!in_array($gid, $orderedSids, true)) {
+                    $orderedSids[] = $gid;
+                }
             }
         }
         try {
@@ -2449,10 +2454,23 @@ class Procuremen extends Backend
                     'email'     => trim((string)($d['email'] ?? '')),
                     'phone'     => $ph,
                     'username'  => $username,
+                    'remark'    => '',
                     'has_quote' => false,
-                    'lines'     => [],
+                    'lines_map' => [],
                 ];
             }
+            if ($byCompany[$cn]['remark'] === '') {
+                $rm = '';
+                foreach (['remark', 'Remark', 'REMARK'] as $rk) {
+                    if (array_key_exists($rk, $d) && $d[$rk] !== null && $d[$rk] !== '') {
+                        $rm = trim((string)$d[$rk]);
+                        break;
+                    }
+                }
+                if ($rm !== '') {
+                    $byCompany[$cn]['remark'] = $rm;
+                }
+            }
             $sid = (int)($d['scydgy_id'] ?? 0);
             $am = trim((string)($d['amount'] ?? ''));
             $gymc = $gymcMap[$sid] ?? trim((string)($d['CGYMC'] ?? $d['cgymc'] ?? ''));
@@ -2493,15 +2511,32 @@ class Procuremen extends Backend
             if (!$quoteVisible) {
                 $this->maskSupplierQuoteLineBeforeDeadline($lineRow);
             }
-            $byCompany[$cn]['lines'][] = $this->ensureSupplierQuoteLineDisplayKeys($lineRow);
+            // 按工序 id 暂存,下面再按上方工序表顺序输出
+            $byCompany[$cn]['lines_map'][$sid] = $this->ensureSupplierQuoteLineDisplayKeys($lineRow);
         }
         foreach ($byCompany as $cn => $g) {
-            $total = count($g['lines']);
+            $linesMap = is_array($g['lines_map'] ?? null) ? $g['lines_map'] : [];
+            $lines = [];
+            $usedSids = [];
+            foreach ($orderedSids as $sid) {
+                if (!isset($linesMap[$sid])) {
+                    continue;
+                }
+                $lines[] = $linesMap[$sid];
+                $usedSids[$sid] = true;
+            }
+            foreach ($linesMap as $sid => $ln) {
+                if (isset($usedSids[$sid])) {
+                    continue;
+                }
+                $lines[] = $ln;
+            }
+            $total = count($lines);
             $quoted = 0;
             $groupTotal = 0.0;
             $groupHasTotal = false;
             if ($quoteVisible) {
-                foreach ($g['lines'] as $ln) {
+                foreach ($lines as $ln) {
                     $am = trim((string)($ln['amount'] ?? ''));
                     if ($am !== '' && $am !== '0' && $am !== '0.00') {
                         $quoted++;
@@ -2512,11 +2547,15 @@ class Procuremen extends Backend
                     }
                 }
             }
+            unset($byCompany[$cn]['lines_map']);
+            $byCompany[$cn]['lines'] = $lines;
             $byCompany[$cn]['has_quote'] = $quoteVisible && $total > 0 && $quoted === $total;
             $byCompany[$cn]['line_count'] = $total;
             $byCompany[$cn]['has_total'] = $total > 0;
+            $byCompany[$cn]['has_remark'] = $total > 0;
             $byCompany[$cn]['total_text'] = ($quoteVisible && $groupHasTotal) ? $this->formatProcuremenMoneyDisplay($groupTotal) : '';
-            $byCompany[$cn]['display_rowspan'] = $total + ($total > 0 ? 1 : 0);
+            // 工序行 + 备注行 + 总计行
+            $byCompany[$cn]['display_rowspan'] = $total > 0 ? ($total + 2) : 0;
         }
 
         return array_values($byCompany);
@@ -2621,10 +2660,23 @@ class Procuremen extends Backend
                     'email'        => trim((string)($d['email'] ?? '')),
                     'phone'        => $ph,
                     'username'     => $username,
+                    'remark'       => '',
                     'pick_lines'   => [],
                     'detail_picks' => [],
                 ];
             }
+            if ($byCompany[$cn]['remark'] === '') {
+                $rm = '';
+                foreach (['remark', 'Remark', 'REMARK'] as $rk) {
+                    if (array_key_exists($rk, $d) && $d[$rk] !== null && $d[$rk] !== '') {
+                        $rm = trim((string)$d[$rk]);
+                        break;
+                    }
+                }
+                if ($rm !== '') {
+                    $byCompany[$cn]['remark'] = $rm;
+                }
+            }
             $gymc = $gymcMap[$sid] ?? trim((string)($d['CGYMC'] ?? $d['cgymc'] ?? ''));
             if ($gymc === '') {
                 $gymc = '工序';
@@ -2702,10 +2754,27 @@ class Procuremen extends Backend
             $g['pick_lines'] = $pickLines;
             $g['line_count'] = $lineCount;
             $g['has_total'] = $lineCount > 0;
+            $g['has_remark'] = $lineCount > 0;
             $g['total_text'] = ($quoteVisible && $groupHasTotal) ? $this->formatProcuremenMoneyDisplay($groupTotal) : '';
-            $g['display_rowspan'] = $lineCount + ($lineCount > 0 ? 1 : 0);
-            $detailPicks = $g['detail_picks'] ?? [];
-            $g['detail_picks'] = array_values(is_array($detailPicks) ? $detailPicks : []);
+            // 工序行 + 备注行 + 总计行
+            $g['display_rowspan'] = $lineCount > 0 ? ($lineCount + 2) : 0;
+            $detailPicksMap = is_array($g['detail_picks'] ?? null) ? $g['detail_picks'] : [];
+            $detailPicks = [];
+            $usedPickSids = [];
+            foreach ($orderedSids as $sid) {
+                if (!isset($detailPicksMap[$sid])) {
+                    continue;
+                }
+                $detailPicks[] = $detailPicksMap[$sid];
+                $usedPickSids[$sid] = true;
+            }
+            foreach ($detailPicksMap as $sid => $dp) {
+                if (isset($usedPickSids[$sid])) {
+                    continue;
+                }
+                $detailPicks[] = $dp;
+            }
+            $g['detail_picks'] = $detailPicks;
             $g['detail_picks_json'] = json_encode($g['detail_picks'], JSON_UNESCAPED_UNICODE);
             unset($g['detail_picks']);
             $out[] = $g;
@@ -4314,6 +4383,15 @@ class Procuremen extends Backend
         $confirmApproveTime = ProcuremenTime::formatDisplayDateTime($confirmApproveTime);
         $doneTime = ProcuremenTime::formatDisplayDateTime($doneTime);
 
+        $deadlineText = '';
+        $sysRqRaw = trim((string)($main['sys_rq'] ?? ''));
+        if ($sysRqRaw !== '' && stripos($sysRqRaw, '0000-00-00') !== 0) {
+            $deadlineDisp = $this->formatProcuremenSysRqForDisplay($sysRqRaw);
+            if ($deadlineDisp !== '' && $deadlineDisp !== '—') {
+                $deadlineText = '截止 ' . $deadlineDisp;
+            }
+        }
+
         $steps = [
             [
                 'title'    => '未发',
@@ -4323,7 +4401,7 @@ class Procuremen extends Backend
             ],
             [
                 'title'    => '下发',
-                'subtitle' => '',
+                'subtitle' => $deadlineText,
                 'time'     => $step2Done ? ($issueTime !== '' ? $issueTime : $poTime) : '',
                 'done'     => $step2Done,
             ],
@@ -4546,6 +4624,17 @@ class Procuremen extends Backend
         $this->view->assign('orderQuoteTotalText', $quoteView['order_total_text']);
         $this->view->assign('orderQuoteTotalHas', $quoteView['order_total_has']);
         $this->view->assign('selectedQuoteCompany', $quoteView['selected_company']);
+        $showSupplierBidResult = (trim((string)($quoteView['selected_company'] ?? '')) !== '')
+            || ProcuremenStatus::isPoCompleted($main['status'] ?? '');
+        if (!$showSupplierBidResult) {
+            foreach ($details as $dr) {
+                if (is_array($dr) && !empty($dr['is_picked'])) {
+                    $showSupplierBidResult = true;
+                    break;
+                }
+            }
+        }
+        $this->view->assign('showSupplierBidResult', $showSupplierBidResult ? 1 : 0);
         $this->view->assign('operLogs', $operLogs);
 
         return [
@@ -5328,7 +5417,7 @@ class Procuremen extends Backend
                 continue;
             }
             $sid = $this->extractScydgyRowId($mr);
-            if ($sid > 0) {
+            if ($this->isValidScydgyRowId($sid)) {
                 $orderedSids[] = $sid;
             }
             $qty = trim((string)($mr['This_quantity'] ?? ''));
@@ -5433,17 +5522,37 @@ class Procuremen extends Backend
             if ($username === '' && $ph !== '') {
                 $username = $this->resolveCustomerContactName($ph, $cn);
             }
+            $remark = '';
+            foreach ($bySid as $d) {
+                if (!is_array($d)) {
+                    continue;
+                }
+                $rm = '';
+                foreach (['remark', 'Remark', 'REMARK'] as $rk) {
+                    if (array_key_exists($rk, $d) && $d[$rk] !== null && $d[$rk] !== '') {
+                        $rm = trim((string)$d[$rk]);
+                        break;
+                    }
+                }
+                if ($rm !== '') {
+                    $remark = $rm;
+                    break;
+                }
+            }
             $lineCount = count($lines);
+            $hasRemark = $lineCount > 0;
             $supplierGroups[] = [
                 'company_name'   => $cn,
                 'username'       => $username,
                 'email'          => is_array($firstDetail) ? trim((string)($firstDetail['email'] ?? '')) : '',
                 'phone'          => $ph,
+                'remark'         => $remark,
+                'has_remark'     => $hasRemark,
                 'is_selected'    => ($selectedCompany !== '' && $cn === $selectedCompany),
                 'is_void'        => $groupVoid,
                 'lines'          => $lines,
                 'line_count'     => $lineCount,
-                'display_rowspan'=> $lineCount + ($lineCount > 0 ? 1 : 0),
+                'display_rowspan'=> $lineCount > 0 ? ($lineCount + 2) : 0,
                 'total_text'     => ($quoteVisible && $groupHas) ? $this->formatProcuremenMoneyDisplay($groupTotal) : '',
                 'has_total'      => $lineCount > 0,
             ];
@@ -6535,12 +6644,16 @@ class Procuremen extends Backend
             } catch (\Throwable $e) {
                 $this->error($e->getMessage());
             }
-            $this->success('新增成功', '', ['scydgy_id' => $sid]);
+            $this->success('新增成功', '', [
+                'scydgy_id'       => $sid,
+                'nextOrderCcydh'  => $this->allocateManualOrderCcydh(),
+            ]);
         }
 
         [, $adminName] = $this->GetUseName();
         $this->view->assign('adminNickname', $adminName);
         $this->view->assign('nextOrderCcydh', $this->allocateManualOrderCcydh());
+        $this->view->assign('defaultCclbmmc', '营销中心');
 
         return $this->view->fetch();
     }

+ 2 - 2
application/admin/view/procuremen/add.html

@@ -20,7 +20,7 @@
         <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">订单号:</label>
             <div class="col-xs-12 col-sm-8">
-                <input class="form-control" type="text" value="{$nextOrderCcydh|default=''|htmlentities}" readonly>
+                <input id="add-next-ccydh" class="form-control" type="text" value="{$nextOrderCcydh|default=''|htmlentities}" readonly>
             </div>
         </div>
         <div class="form-group">
@@ -32,7 +32,7 @@
         <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">承揽部门:</label>
             <div class="col-xs-12 col-sm-8">
-                <input class="form-control" name="row[CCLBMMC]" type="text" autocomplete="off">
+                <input class="form-control" name="row[CCLBMMC]" type="text" value="{$defaultCclbmmc|default='营销中心'|htmlentities}" autocomplete="off">
             </div>
         </div>
         <div class="form-group">

+ 52 - 14
application/admin/view/procuremen/audit_issue.html

@@ -21,8 +21,10 @@
         border-radius: 3px;
     }
     .audit-issue-wrap .audit-table-wrap {
-        max-height: 240px;
-        overflow: auto;
+        /* 不在表格区域内部滚动,由弹窗页面整体滚动 */
+        max-height: none;
+        overflow-x: auto;
+        overflow-y: visible;
         margin-bottom: 12px;
         border: 1px solid #e5e5e5;
     }
@@ -33,12 +35,22 @@
         width: 100%;
         min-width: 980px;
     }
+    .audit-issue-wrap .audit-process-table col:nth-child(3) {
+        width: 130px;
+    }
+    .audit-issue-wrap .audit-process-table col:nth-child(4) {
+        width: 80px;
+    }
+    .audit-issue-wrap .audit-process-table td.audit-process-name {
+        white-space: nowrap;
+    }
     .audit-issue-wrap .audit-process-table th {
         background: #f5f5f5;
         white-space: nowrap;
         font-weight: 600;
         padding: 6px 8px;
         vertical-align: middle;
+        border: 1px solid #ddd !important;
     }
     .audit-issue-wrap .audit-process-table th.text-center,
     .audit-issue-wrap .audit-process-table td.text-center {
@@ -48,19 +60,24 @@
         padding: 6px 8px;
         vertical-align: middle;
         word-wrap: break-word;
+        border: 1px solid #ddd !important;
     }
     .audit-issue-wrap .audit-table {
         margin: 0;
         font-size: 12px;
+        border-collapse: collapse;
     }
     .audit-issue-wrap .audit-table th {
         background: #f5f5f5;
         white-space: nowrap;
+        font-weight: 600;
+        border: 1px solid #ddd !important;
     }
     .audit-issue-wrap .audit-table td {
         padding: 6px 8px;
         vertical-align: middle;
         word-wrap: break-word;
+        border: 1px solid #ddd !important;
     }
     .audit-issue-wrap .audit-quote-pick-table tbody tr {
         cursor: pointer;
@@ -147,7 +164,9 @@
         margin: 0 2px 2px 0;
     }
     .audit-issue-wrap .audit-table-wrap.audit-quote-table-wrap {
-        max-height: 360px;
+        max-height: none;
+        overflow-x: auto;
+        overflow-y: visible;
     }
     .audit-issue-wrap .audit-quote-detail-table {
         min-width: 1320px;
@@ -220,17 +239,28 @@
 <div class="audit-issue-wrap">
     <div class="audit-table-wrap">
         <table class="table table-bordered table-condensed audit-process-table">
+            <colgroup>
+                <col style="width:100px"/>
+                <col style="width:26%"/>
+                <col style="width:130px"/>
+                <col style="width:80px"/>
+                <col style="width:72px"/>
+                <col style="width:72px"/>
+                <col style="width:72px"/>
+                <col style="width:80px"/>
+                <col/>
+            </colgroup>
             <thead>
             <tr>
-                <th class="text-center" style="width:100px;">订单号</th>
-                <th style="min-width:160px;">印件名称</th>
+                <th class="text-center">订单号</th>
+                <th>印件名称</th>
                 <th>工序名称</th>
-                <th class="text-center" style="width:56px;">单位</th>
-                <th class="text-center" style="width:72px;">工作量</th>
-                <th class="text-center" style="width:72px;">本次数量</th>
-                <th class="text-center" style="width:72px;">最高限价</th>
-                <th class="text-center" style="width:80px;">订法</th>
-                <th style="min-width:120px;">备注</th>
+                <th class="text-center">单位</th>
+                <th class="text-center">工作量</th>
+                <th class="text-center">本次数量</th>
+                <th class="text-center">最高限价</th>
+                <th class="text-center">订法</th>
+                <th>备注</th>
             </tr>
             </thead>
             <tbody>
@@ -240,7 +270,7 @@
                 <td class="text-center"{if condition="$pr.order_rowspan gt 1"} rowspan="{$pr.order_rowspan}"{/if}>{$pr.CCYDH|default=''}</td>
                 <td{if condition="$pr.order_rowspan gt 1"} rowspan="{$pr.order_rowspan}"{/if}>{$pr.CYJMC|default=''}</td>
                 {/if}
-                <td>{$pr.CGYMC|default=''}</td>
+                <td class="audit-process-name">{$pr.CGYMC|default=''}</td>
                 <td class="text-center">{$pr.CDW|default=''}</td>
                 <td class="text-center">{$pr.NGZL|default=''}</td>
                 <td class="text-center">{$pr.This_quantity|default=''}</td>
@@ -300,7 +330,7 @@
                 <th style="width:88px;">姓名</th>
                 <th style="min-width:160px;">邮箱</th>
                 <th style="width:120px;">手机号</th>
-                <th style="min-width:120px;">工序名称</th>
+                <th style="width:130px;">工序名称</th>
                 <th class="text-center" style="width:112px;">单价</th>
                 <th class="text-center" style="width:118px;">交货日期</th>
                 <th class="text-center" style="width:100px;">小计</th>
@@ -339,9 +369,17 @@
                 {/if}
             </tr>
             {/volist}
+            {if !empty($co.has_remark)}
+            <tr{if !empty($co.is_void)} class="text-muted"{/if}>
+                <td><strong>备注</strong></td>
+                <td colspan="3" style="text-align:left;vertical-align:middle;">{$co.remark|default=''|htmlentities}</td>
+            </tr>
+            {/if}
             {if !empty($co.has_total)}
             <tr class="active">
-                <td colspan="3" class="text-right"><strong>总计</strong></td>
+                <td><strong>总计</strong></td>
+                <td></td>
+                <td></td>
                 <td class="text-center"><strong>{$co.total_text|default=''|htmlentities}</strong></td>
             </tr>
             {/if}

+ 92 - 26
application/admin/view/procuremen/details_fragment.html

@@ -157,13 +157,13 @@
         font-weight: 600;
         padding: 8px 10px;
         vertical-align: middle;
-        border: 1px solid #ddd;
+        border: 1px solid #ddd !important;
     }
     .procuremen-details-wrap .details-process-table td {
         padding: 8px 10px;
         vertical-align: middle;
         word-wrap: break-word;
-        border: 1px solid #ddd;
+        border: 1px solid #ddd !important;
     }
     .procuremen-details-wrap .details-process-table th.text-center,
     .procuremen-details-wrap .details-process-table td.text-center {
@@ -210,14 +210,53 @@
     }
     .procuremen-details-wrap .detail-mini {
         font-size: 12px;
+        border-collapse: collapse;
     }
     .procuremen-details-wrap .detail-mini th,
     .procuremen-details-wrap .detail-mini td {
         padding: 6px 8px;
         vertical-align: middle;
+        border: 1px solid #ddd !important;
+    }
+    .procuremen-details-wrap .detail-mini thead th {
+        background: #f5f5f5;
+        font-weight: 600;
+        white-space: nowrap;
     }
     .procuremen-details-wrap .detail-supplier-table {
-        min-width: 1180px;
+        table-layout: fixed;
+        width: 100%;
+        min-width: 1100px;
+        border-collapse: collapse;
+    }
+    .procuremen-details-wrap .detail-supplier-table th.col-supplier-name,
+    .procuremen-details-wrap .detail-supplier-table td.col-supplier-name {
+        width: 22%;
+        min-width: 250px;
+        word-break: break-word;
+    }
+    .procuremen-details-wrap .detail-supplier-table th.col-supplier-email,
+    .procuremen-details-wrap .detail-supplier-table td.col-supplier-email {
+        width: 110px;
+        word-break: break-all;
+    }
+    .procuremen-details-wrap .detail-supplier-table th.col-supplier-user,
+    .procuremen-details-wrap .detail-supplier-table td.col-supplier-user {
+        width: 72px;
+    }
+    .procuremen-details-wrap .detail-supplier-table th.col-supplier-phone,
+    .procuremen-details-wrap .detail-supplier-table td.col-supplier-phone {
+        width: 120px;
+        word-break: break-all;
+    }
+    .procuremen-details-wrap .detail-supplier-table th.col-op-time,
+    .procuremen-details-wrap .detail-supplier-table td.col-op-time {
+        width: 148px;
+        white-space: nowrap;
+    }
+    .procuremen-details-wrap .detail-supplier-table > thead > tr > th,
+    .procuremen-details-wrap .detail-supplier-table > tbody > tr > td {
+        border: 1px solid #ddd !important;
     }
     .procuremen-details-wrap .details-supplier-table-wrap {
         overflow-x: auto;
@@ -228,6 +267,21 @@
     .procuremen-details-wrap .detail-supplier-table td.detail-quote-empty {
         color: #e67e22;
     }
+    .procuremen-details-wrap .detail-supplier-remark-row td {
+        background: #f5f5f5;
+        vertical-align: middle;
+        font-size: inherit;
+        color: #333;
+    }
+    .procuremen-details-wrap .detail-supplier-remark-row .detail-remark-label {
+        white-space: nowrap;
+        font-weight: 700;
+    }
+    .procuremen-details-wrap .detail-supplier-remark-row .detail-remark-text {
+        text-align: left;
+        word-break: break-all;
+        line-height: 1.45;
+    }
     html.procuremen-details-dialog .procuremen-details-wrap .proc-step-item .proc-step-time:empty {
         display: none;
         margin: 0;
@@ -341,8 +395,8 @@
             <tr>
                 <th class="text-center" style="width:100px;">订单号</th>
                 <th style="min-width:160px;">印件名称</th>
-                <th>工序名称</th>
-                <th class="text-center" style="width:56px;">单位</th>
+                <th style="width:88px;">工序名称</th>
+                <th class="text-center" style="width:80px;">单位</th>
                 <th class="text-center" style="width:88px;">本次数量</th>
                 <th class="text-center" style="width:72px;">最高限价</th>
                 <th class="text-center" style="width:80px;">订法</th>
@@ -380,16 +434,16 @@
         <table class="table table-bordered table-condensed detail-mini detail-supplier-table">
             <thead>
             <tr>
-                <th style="min-width:140px;">供应商名称</th>
-                <th style="width:88px;">姓名</th>
-                <th style="min-width:160px;">邮箱</th>
-                <th style="width:120px;">手机号</th>
-                <th style="min-width:120px;">工序名称</th>
-                <th class="text-center" style="width:88px;">单价</th>
+                <th class="col-supplier-name">供应商名称</th>
+                <th class="col-supplier-user" style="width:72px;">姓名</th>
+                <th class="col-supplier-email" style="width:110px;">邮箱</th>
+                <th class="col-supplier-phone" style="width:120px;">手机号</th>
+                <th style="width:120px;">工序名称</th>
+                <th class="text-center" style="width:84px;">单价</th>
                 <th class="text-center" style="width:100px;">交货日期</th>
                 <th class="text-center" style="width:88px;">小计</th>
-                <th class="text-center" style="width:88px;">采购确认</th>
-                <th style="width:140px;">操作时间</th>
+                <th class="text-center" style="width:88px;">状态</th>
+                <th class="col-op-time" style="width:148px;">操作时间</th>
             </tr>
             </thead>
             <tbody>
@@ -398,12 +452,12 @@
             {volist name="sg.lines" id="ln" key="lk"}
             <tr{if !empty($sg.is_void)} class="text-muted"{/if}>
                 {if $lk == 1}
-                <td{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">
+                <td class="col-supplier-name"{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">
                     {$sg.company_name|default=''|htmlentities}
                 </td>
-                <td{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">{$sg.username|default=''|htmlentities}</td>
-                <td{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">{:htmlentities(mask_email(isset($sg['email']) ? $sg['email'] : ''))}</td>
-                <td{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">{:htmlentities(mask_phone(isset($sg['phone']) ? $sg['phone'] : ''))}</td>
+                <td class="col-supplier-user"{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">{$sg.username|default=''|htmlentities}</td>
+                <td class="col-supplier-email"{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">{:htmlentities(mask_email(isset($sg['email']) ? $sg['email'] : ''))}</td>
+                <td class="col-supplier-phone"{if condition="$sg.display_rowspan gt 1"} rowspan="{$sg.display_rowspan}"{/if} style="vertical-align:middle;">{:htmlentities(mask_phone(isset($sg['phone']) ? $sg['phone'] : ''))}</td>
                 {/if}
                 <td>{$ln.cgymc|default=''|htmlentities}</td>
                 <td class="text-center">{$ln.unit_price_text|default=''|htmlentities}</td>
@@ -413,17 +467,27 @@
                     {if !empty($ln.is_void)}
                     <span class="label label-default">历史</span>
                     {elseif !empty($ln.is_picked) /}
-                    <span class="label label-success">已选</span>
+                    <span class="label label-success">中标</span>
+                    {elseif !empty($showSupplierBidResult) /}
+                    <span class="label label-danger">未中标</span>
                     {else /}
                     <span class="text-muted"> </span>
                     {/if}
                 </td>
-                <td>{$ln.oper_time_text|default=''|htmlentities}</td>
+                <td class="col-op-time">{$ln.oper_time_text|default=''|htmlentities}</td>
             </tr>
             {/volist}
+            {if !empty($sg.has_remark)}
+            <tr class="detail-supplier-remark-row{if !empty($sg.is_void)} text-muted{/if}">
+                <td class="detail-remark-label"><strong>备注</strong></td>
+                <td class="detail-remark-text" colspan="5">{$sg.remark|default=''|htmlentities}</td>
+            </tr>
+            {/if}
             {if !empty($sg.has_total)}
             <tr class="active">
-                <td colspan="3" class="text-right"><strong>总计</strong></td>
+                <td><strong>总计</strong></td>
+                <td></td>
+                <td></td>
                 <td class="text-center"><strong>{$sg.total_text|default=''|htmlentities}</strong></td>
                 <td colspan="2"></td>
             </tr>
@@ -433,10 +497,10 @@
             {notempty name="detailRows"}
             {volist name="detailRows" id="dr"}
             <tr>
-                <td>{$dr.company_name|default=''|htmlentities}</td>
-                <td>{$dr.username|default=''|htmlentities}</td>
-                <td>{:htmlentities(mask_email(isset($dr['email']) ? $dr['email'] : ''))}</td>
-                <td>{:htmlentities(mask_phone(isset($dr['phone']) ? $dr['phone'] : ''))}</td>
+                <td class="col-supplier-name">{$dr.company_name|default=''|htmlentities}</td>
+                <td class="col-supplier-user">{$dr.username|default=''|htmlentities}</td>
+                <td class="col-supplier-email">{:htmlentities(mask_email(isset($dr['email']) ? $dr['email'] : ''))}</td>
+                <td class="col-supplier-phone">{:htmlentities(mask_phone(isset($dr['phone']) ? $dr['phone'] : ''))}</td>
                 <td></td>
                 <td class="text-center">{$dr.amount|default=''|htmlentities}</td>
                 <td class="text-center">{$dr.delivery_ymd|default=''|htmlentities}</td>
@@ -445,12 +509,14 @@
                     {if isset($dr.is_void) && $dr.is_void}
                     <span class="label label-default">历史下发</span>
                     {elseif !empty($dr.is_picked) /}
-                    <span class="label label-success">已选</span>
+                    <span class="label label-success">中标</span>
+                    {elseif !empty($showSupplierBidResult) /}
+                    <span class="label label-danger">未中标</span>
                     {else /}
                     <span class="text-muted"> </span>
                     {/if}
                 </td>
-                <td>{$dr.oper_time_text|default=''|htmlentities}</td>
+                <td class="col-op-time">{$dr.oper_time_text|default=''|htmlentities}</td>
             </tr>
             {/volist}
             {else /}

+ 9 - 11
application/admin/view/procuremen/index.html

@@ -524,28 +524,26 @@
         vertical-align: middle;
         line-height: 1.4;
     }
-    /* 表头:浅灰底、无竖线,仅底部分隔线(padding 见上方 .th-inner) */
+    /* 表头:浅灰底 + 完整边框 */
     #procuremen-layout .bootstrap-table .table > thead > tr > th,
     #procuremen-layout .bootstrap-table .fixed-table-header .table > thead > tr > th,
     #procuremen-layout .bootstrap-table .fixed-columns-right .table > thead > tr > th {
         background: #f5f7fa !important;
         color: #303133 !important;
         font-weight: 600 !important;
-        border: none !important;
-        border-bottom: 1px solid #e4e7ed !important;
+        border: 1px solid #e4e7ed !important;
         padding: 0 !important;
     }
-    /* 表体:白底、无竖线,仅横线 */
+    /* 表体:白底 + 单元格边框 */
     #procuremen-layout .bootstrap-table .table > tbody > tr > td,
     #procuremen-layout .bootstrap-table .fixed-columns-right .table > tbody > tr > td {
         background: #fff !important;
-        border: none !important;
-        border-bottom: 1px solid #ebeef5 !important;
+        border: 1px solid #ebeef5 !important;
         color: #606266;
     }
     #procuremen-layout .bootstrap-table .table,
     #procuremen-layout .bootstrap-table .table-bordered {
-        border: none !important;
+        border: 1px solid #e4e7ed !important;
     }
     /* 长文本列:不省略,允许换行完整显示 */
     #procuremen-layout .bootstrap-table .table > tbody > tr > td.procuremen-cell-wrap,
@@ -786,12 +784,12 @@
         top: 0;
         background: #f5f5f5;
         z-index: 1;
-        border-bottom: 1px solid #f0f0f0;
-        color: #595959;
-        font-weight: 500;
+        border: 1px solid #ddd !important;
+        color: #333;
+        font-weight: 600;
     }
     body .layui-layer-procuremen-finish .procuremen-confirm-table tbody td {
-        border-color: #f5f5f5;
+        border: 1px solid #ddd !important;
         color: #434343;
     }
     body .layui-layer-procuremen-finish .layui-layer-btn {

+ 47 - 13
application/admin/view/procuremen/outward_detail.html

@@ -45,7 +45,12 @@
         font-size: 12px;
         table-layout: fixed;
         width: 100%;
-        min-width: 1320px;
+        min-width: 1100px;
+    }
+    .outward-confirm-process-table th:nth-child(3),
+    .outward-confirm-process-table td.outward-process-name,
+    .outward-confirm-company-table td.outward-process-name {
+        white-space: nowrap;
     }
     .outward-detail-table > thead > tr > th,
     .outward-detail-table > tbody > tr > td,
@@ -65,10 +70,20 @@
         background: #f5f5f5;
         font-weight: 600;
         white-space: nowrap;
+        border: 1px solid #ddd !important;
+    }
+    .outward-confirm-process-table td,
+    .outward-confirm-company-table td {
+        border: 1px solid #ddd !important;
     }
     .outward-detail-table > thead > tr > th {
         font-weight: 600;
         white-space: nowrap;
+        background: #f5f5f5;
+        border: 1px solid #ddd !important;
+    }
+    .outward-detail-table > tbody > tr > td {
+        border: 1px solid #ddd !important;
     }
     .outward-detail-table .col-title {
         white-space: normal;
@@ -223,17 +238,28 @@
     {if $processDisplayRows}
     <div class="outward-confirm-process-wrap">
         <table class="table table-bordered table-condensed outward-confirm-process-table">
+            <colgroup>
+                <col style="width:100px"/>
+                <col style="width:26%"/>
+                <col style="width:120px"/>
+                <col style="width:80px"/>
+                <col style="width:72px"/>
+                <col style="width:72px"/>
+                <col style="width:72px"/>
+                <col style="width:80px"/>
+                <col/>
+            </colgroup>
             <thead>
             <tr>
-                <th class="text-center" style="width:100px;">订单号</th>
-                <th style="min-width:160px;">印件名称</th>
+                <th class="text-center">订单号</th>
+                <th>印件名称</th>
                 <th>工序名称</th>
-                <th class="text-center" style="width:56px;">单位</th>
-                <th class="text-center" style="width:72px;">工作量</th>
-                <th class="text-center" style="width:72px;">本次数量</th>
-                <th class="text-center" style="width:72px;">最高限价</th>
-                <th class="text-center" style="width:80px;">订法</th>
-                <th style="min-width:120px;">备注</th>
+                <th class="text-center">单位</th>
+                <th class="text-center">工作量</th>
+                <th class="text-center">本次数量</th>
+                <th class="text-center">最高限价</th>
+                <th class="text-center">订法</th>
+                <th>备注</th>
             </tr>
             </thead>
             <tbody>
@@ -243,7 +269,7 @@
                 <td class="text-center"{if condition="$pr.order_rowspan gt 1"} rowspan="{$pr.order_rowspan}"{/if}>{$pr.CCYDH|default=''}</td>
                 <td{if condition="$pr.order_rowspan gt 1"} rowspan="{$pr.order_rowspan}"{/if}>{$pr.CYJMC|default=''}</td>
                 {/if}
-                <td>{$pr.CGYMC|default=''}</td>
+                <td class="outward-process-name">{$pr.CGYMC|default=''}</td>
                 <td class="text-center">{$pr.CDW|default=''}</td>
                 <td class="text-center">{$pr.NGZL|default=''}</td>
                 <td class="text-center">{$pr.This_quantity|default=''}</td>
@@ -285,7 +311,7 @@
                 <th style="width:88px;">姓名</th>
                 <th style="min-width:160px;">邮箱</th>
                 <th style="width:120px;">手机号</th>
-                <th style="min-width:120px;">工序名称</th>
+                <th style="width:120px;">工序名称</th>
                 <th class="text-center" style="width:112px;">单价</th>
                 <th class="text-center" style="width:118px;">交货日期</th>
                 <th class="text-center" style="width:100px;">小计</th>
@@ -308,15 +334,23 @@
                 <td{if condition="$co.display_rowspan gt 1"} rowspan="{$co.display_rowspan}"{/if} style="vertical-align:middle;">{:htmlentities(mask_email(isset($co['email']) ? $co['email'] : ''))}</td>
                 <td{if condition="$co.display_rowspan gt 1"} rowspan="{$co.display_rowspan}"{/if} style="vertical-align:middle;">{:htmlentities(mask_phone(isset($co['phone']) ? $co['phone'] : ''))}</td>
                 {/if}
-                <td>{$ql.cgymc|default=''|htmlentities}</td>
+                <td class="outward-process-name">{$ql.cgymc|default=''|htmlentities}</td>
                 <td class="text-center{if condition="!empty($ql.amount_quote_pending)"} outward-quote-empty{elseif condition="$ql.amount_filled neq 1"} outward-quote-empty{/if}">{$ql.unit_price_text|default='未填写'|htmlentities}</td>
                 <td class="text-center{if condition="!empty($ql.delivery_quote_pending)"} outward-quote-empty{elseif condition="$ql.delivery_filled neq 1"} outward-quote-empty{/if}">{$ql.delivery_text|default='未填写'|htmlentities}</td>
                 <td class="text-center">{$ql.subtotal_text|default=''|htmlentities}</td>
             </tr>
             {/volist}
+            {if !empty($co.has_remark)}
+            <tr class="outward-confirm-supplier-row{if !empty($co.is_void)} text-muted{/if}" data-supplier-idx="{$k-1}">
+                <td><strong>备注</strong></td>
+                <td colspan="3" style="text-align:left;vertical-align:middle;">{$co.remark|default=''|htmlentities}</td>
+            </tr>
+            {/if}
             {if !empty($co.has_total)}
             <tr class="active outward-confirm-supplier-row" data-supplier-idx="{$k-1}">
-                <td colspan="3" class="text-right"><strong>总计</strong></td>
+                <td><strong>总计</strong></td>
+                <td></td>
+                <td></td>
                 <td class="text-center"><strong>{$co.total_text|default=''|htmlentities}</strong></td>
             </tr>
             {/if}

+ 7 - 1
application/admin/view/procuremen/review.html

@@ -327,7 +327,13 @@
         top: 0;
         z-index: 3;
         background-color: #f5f5f5;
-        box-shadow: 0 1px 0 #ddd;
+        border: 1px solid #ddd !important;
+        box-shadow: none;
+    }
+    .review-table-scroll .review-merge-table > thead > tr > th,
+    .review-table-scroll .review-merge-table > tbody > tr > td,
+    .review-table-scroll .review-company-table > tbody > tr > td {
+        border: 1px solid #ddd !important;
     }
     .review-table-scroll .review-company-table > thead > tr > th.review-th-cb {
         z-index: 4;

+ 3 - 0
application/extra/purchase_order_detail_remark_install.sql

@@ -0,0 +1,3 @@
+-- 手机端供应商整单备注(执行一次)
+ALTER TABLE `purchase_order_detail`
+  ADD COLUMN `remark` varchar(500) DEFAULT NULL COMMENT '供应商整单备注' AFTER `status_name`;

+ 1 - 1
application/extra/site.php

@@ -5,7 +5,7 @@ return array (
   'brand_logo' => 'https://a-7in6-com.oss-cn-hangzhou.aliyuncs.com/xinhua/img/logo1.png',
   'beian' => '',
   'cdnurl' => '',
-  'version' => '1.10.1',
+  'version' => '1.10.8',
   'timezone' => 'Asia/Shanghai',
   'forbiddenip' => '',
   'languages' => 

+ 477 - 46
application/index/controller/Index.php

@@ -626,6 +626,26 @@ class Index extends Frontend
         return null;
     }
 
+    /**
+     * 供应商整单备注(purchase_order_detail.remark)
+     *
+     * @param array<string, mixed> $row
+     */
+    protected function mprocResolveDetailRemark(array $row): string
+    {
+        $col = $this->mprocResolveProcuremenColumn(['remark', 'memo', 'bz', 'beizhu']);
+        if ($col === null) {
+            return '';
+        }
+        foreach ($row as $k => $v) {
+            if (strcasecmp((string)$k, $col) === 0) {
+                return trim((string)$v);
+            }
+        }
+
+        return '';
+    }
+
     /**
      * 列表:非管理员按 company_name 与登录时解析的单位名一致;管理员不加条件
      *
@@ -1273,6 +1293,186 @@ class Index extends Frontend
         if ($ceilRaw !== '') {
             $row['ceilingPrice'] = $ceilRaw;
         }
+        $sysRq = '';
+        foreach (['sys_rq', 'SYS_RQ'] as $sk) {
+            if (array_key_exists($sk, $pl) && $pl[$sk] !== null && $pl[$sk] !== '') {
+                $sysRq = trim((string)$pl[$sk]);
+                break;
+            }
+            if (array_key_exists($sk, $poRow) && $poRow[$sk] !== null && $poRow[$sk] !== '') {
+                $sysRq = trim((string)$poRow[$sk]);
+                break;
+            }
+        }
+        if ($sysRq !== '' && !preg_match('/^0000-00-00/i', $sysRq)) {
+            $row['sys_rq'] = $sysRq;
+        }
+    }
+
+    /**
+     * 主表报价截止时间(未设置则视为未截止)
+     *
+     * @param array<string, mixed>|null $po
+     */
+    protected function mprocResolveSysRqFromPo(?array $po): string
+    {
+        if (!is_array($po)) {
+            return '';
+        }
+        $sr = trim((string)($po['sys_rq'] ?? $po['SYS_RQ'] ?? ''));
+
+        return ($sr !== '' && !preg_match('/^0000-00-00/i', $sr)) ? $sr : '';
+    }
+
+    /**
+     * 手机端:仅当主表设置了 sys_rq 且已到期时视为截止(无截止时间仍可填报)
+     *
+     * @param array<string, mixed>|null $po
+     */
+    protected function mprocIsQuoteDeadlineReachedForPo(?array $po): bool
+    {
+        $raw = $this->mprocResolveSysRqFromPo($po);
+        if ($raw === '') {
+            return false;
+        }
+        $ts = strtotime(str_replace('T', ' ', $raw));
+        if ($ts === false || $ts <= 0) {
+            return false;
+        }
+
+        return time() >= $ts;
+    }
+
+    /**
+     * 主单已完结后:中标 / 未中标
+     *
+     * @param array<string, mixed>      $row
+     * @param array<string, mixed>|null $po
+     */
+    protected function mprocResolvePickResultText(array $row, ?array $po): string
+    {
+        if (!is_array($po) || !ProcuremenStatus::isPoCompleted($po['status'] ?? $po['STATUS'] ?? '')) {
+            return '';
+        }
+        $detailStatus = $row['status'] ?? $row['STATUS'] ?? '';
+
+        return ProcuremenStatus::isPodPicked($detailStatus) ? '中标' : '未中标';
+    }
+
+    /**
+     * 手机端左侧 Tab:draft|submitted|done
+     *
+     * @param array<string, mixed>      $row
+     * @param array<string, mixed>|null $po
+     */
+    protected function mprocResolveListTabForRow(array $row, ?array $po, string $effectiveSn): string
+    {
+        if (in_array($effectiveSn, ['已完成', '未通过', '已废弃'], true)) {
+            return 'done';
+        }
+        if ($this->mprocIsQuoteDeadlineReachedForPo($po)) {
+            return 'done';
+        }
+        if ($effectiveSn === '已提交') {
+            return 'submitted';
+        }
+
+        return 'draft';
+    }
+
+    /**
+     * 同一订单号 + 供应商合并为一张卡片
+     *
+     * @param array<int, array<string, mixed>> $rows
+     * @return array<int, array<string, mixed>>
+     */
+    protected function mprocGroupRowsByOrder(array $rows): array
+    {
+        $groups = [];
+        $order = [];
+        foreach ($rows as $row) {
+            if (!is_array($row)) {
+                continue;
+            }
+            $ccydh = trim((string)($row['CCYDH'] ?? ''));
+            $cname = trim((string)($row['company_name'] ?? ''));
+            $key = ($ccydh !== '' ? $ccydh : ('eid_' . (int)($row['eid'] ?? 0))) . '|' . $cname;
+            if (!isset($groups[$key])) {
+                $groups[$key] = [
+                    'group_key'    => $key,
+                    'CCYDH'        => $ccydh,
+                    'CYJMC'        => trim((string)($row['CYJMC'] ?? '')),
+                    'company_name' => $cname,
+                    'lines'        => [],
+                ];
+                $order[] = $key;
+            }
+            $groups[$key]['lines'][] = $row;
+        }
+        $out = [];
+        foreach ($order as $key) {
+            $g = $groups[$key];
+            $lines = is_array($g['lines'] ?? null) ? $g['lines'] : [];
+            usort($lines, function ($a, $b) {
+                $sa = (int)($a['scydgy_id'] ?? 0);
+                $sb = (int)($b['scydgy_id'] ?? 0);
+                if ($sa !== $sb) {
+                    return $sa <=> $sb;
+                }
+
+                return ((int)($a['eid'] ?? 0)) <=> ((int)($b['eid'] ?? 0));
+            });
+            $g['lines'] = $lines;
+            $g['line_count'] = count($lines);
+            $canEdit = false;
+            foreach ($lines as $ln) {
+                if (is_array($ln) && (int)($ln['mproc_can_edit'] ?? 0) === 1) {
+                    $canEdit = true;
+                    break;
+                }
+            }
+            $g['can_edit'] = $canEdit ? 1 : 0;
+            $remark = '';
+            $doneLabel = '';
+            $pickResult = '';
+            $hasWin = false;
+            $hasLose = false;
+            $hasExpired = false;
+            foreach ($lines as $ln) {
+                if (!is_array($ln)) {
+                    continue;
+                }
+                $rm = trim((string)($ln['mproc_remark'] ?? ''));
+                if ($rm !== '' && $remark === '') {
+                    $remark = $rm;
+                }
+                $pr = trim((string)($ln['mproc_pick_result'] ?? ''));
+                $dl = trim((string)($ln['mproc_done_label'] ?? ''));
+                if ($pr === '中标' || $dl === '中标') {
+                    $hasWin = true;
+                } elseif ($pr === '未中标' || $dl === '未中标') {
+                    $hasLose = true;
+                } elseif ($dl === '已截止') {
+                    $hasExpired = true;
+                }
+            }
+            if ($hasWin) {
+                $doneLabel = '中标';
+                $pickResult = '中标';
+            } elseif ($hasLose) {
+                $doneLabel = '未中标';
+                $pickResult = '未中标';
+            } elseif ($hasExpired) {
+                $doneLabel = '已截止';
+                $pickResult = '';
+            }
+            $g['remark'] = $remark;
+            $g['mproc_done_label'] = $doneLabel;
+            $g['mproc_pick_result'] = $pickResult;
+            $out[] = $g;
+        }
+
+        return $out;
     }
 
     /**
@@ -1296,10 +1496,7 @@ class Index extends Frontend
             $this->mprocSyncLegacyApprovedStatusNames($user, $statusNameCol);
         }
         $this->mprocApplySearchKeywordToDetailQuery($query, $q);
-        // 有搜索词时不在此按 status_name 分栏筛选,全局匹配;无搜索词时仍按左侧 Tab(未提交/已提交/已完成)筛选
-        if (trim((string)$q) === '') {
-            $this->mprocApplyListTabConditions($query, $tab, $statusNameCol);
-        }
+        // Tab 筛选在 PHP 层按截止时间、审批结果综合判断(含逾期进「已完成」、未中标等)
 
         try {
             $rows = $query->limit(500)->select();
@@ -1354,13 +1551,24 @@ class Index extends Frontend
             if ($statusNameCol !== null && $effectiveSn !== $oldSn && $row['eid'] > 0) {
                 $this->mprocPersistDetailStatusName((int)$row['eid'], $statusNameCol, $effectiveSn);
             }
+            $listTab = $this->mprocResolveListTabForRow($row, $poRow, $effectiveSn);
+            $row['mproc_list_tab'] = $listTab;
+            $row['mproc_deadline_reached'] = $this->mprocIsQuoteDeadlineReachedForPo($poRow) ? 1 : 0;
+            $row['mproc_pick_result'] = $this->mprocResolvePickResultText($row, $poRow);
+            if ($row['mproc_pick_result'] === '' && $listTab === 'done' && $row['mproc_deadline_reached']) {
+                $row['mproc_done_label'] = '已截止';
+            } elseif ($row['mproc_pick_result'] !== '') {
+                $row['mproc_done_label'] = $row['mproc_pick_result'];
+            } else {
+                $row['mproc_done_label'] = '';
+            }
             // status_name 由库表/后端维护,不在此根据 amount 覆盖
             if (!isset($row['status_name']) || $row['status_name'] === null) {
                 $row['status_name'] = '';
                     } else {
                 $row['status_name'] = trim((string)$row['status_name']);
             }
-            $row['mproc_can_edit'] = $this->mprocCanEditRow($user, $row) ? 1 : 0;
+            $row['mproc_can_edit'] = $this->mprocCanEditRow($user, $row, $poRow) ? 1 : 0;
 
             $am = $row['amount'] ?? null;
             if ($am === null || $am === '' || (is_string($am) && trim($am) === '')) {
@@ -1380,23 +1588,21 @@ class Index extends Frontend
             $row['delivery_missing'] = ($dv === '' || preg_match('/^0000-00-00/i', $dv)) ? 1 : 0;
             $row['mproc_fill_hint'] = '';
             $row['mproc_this_quantity_display'] = $this->mprocResolveDisplayThisQuantity($row);
+            $row['mproc_remark'] = $this->mprocResolveDetailRemark($row);
         }
         unset($row);
 
-        if (trim((string)$q) === '' && $statusNameCol !== null) {
-            $tabLabelMap = [
-                'draft'     => '未提交',
-                'submitted' => '已提交',
-                'done'      => '已完成',
-            ];
-            $expectLabel = $tabLabelMap[$tab] ?? '未提交';
-            $rows = array_values(array_filter($rows, function ($r) use ($expectLabel) {
-                return is_array($r) && trim((string)($r['status_name'] ?? '')) === $expectLabel;
+        if (trim((string)$q) === '') {
+            $rows = array_values(array_filter($rows, function ($r) use ($tab) {
+                return is_array($r) && trim((string)($r['mproc_list_tab'] ?? '')) === $tab;
             }));
         }
 
+        $groups = $this->mprocGroupRowsByOrder($rows);
+
         return [
             'rows'             => $rows ?: [],
+            'groups'           => $groups ?: [],
             'done_no_status'   => (int)($statusNameCol === null),
         ];
     }
@@ -1406,7 +1612,7 @@ class Index extends Frontend
      */
     protected function mprocStatusNameToListTab(string $statusName): string
     {
-        $map = ['未提交' => 'draft', '已提交' => 'submitted', '已完成' => 'done'];
+        $map = ['未提交' => 'draft', '已提交' => 'submitted', '已完成' => 'done', '未通过' => 'done', '已废弃' => 'done'];
         $sn = trim($statusName);
 
         return isset($map[$sn]) ? $map[$sn] : '';
@@ -1447,7 +1653,9 @@ class Index extends Frontend
             }
         }
 
-        return $this->mprocStatusNameToListTab(
+        return $this->mprocResolveListTabForRow(
+            $dr,
+            is_array($po) ? $po : null,
             $this->mprocResolveEffectiveStatusName($dr, is_array($po) ? $po : null)
         );
     }
@@ -1486,6 +1694,7 @@ class Index extends Frontend
             array_splice($rows, $foundIdx, 1);
             array_unshift($rows, $hit);
             $bundle['rows'] = $rows;
+            $bundle['groups'] = $this->mprocGroupRowsByOrder($rows);
 
             return $bundle;
         }
@@ -1525,13 +1734,24 @@ class Index extends Frontend
         }
         $effectiveSn = $this->mprocResolveEffectiveStatusName($row, is_array($poRow) ? $poRow : null);
         if (trim((string)$q) === '') {
-            $rowTab = $this->mprocStatusNameToListTab($effectiveSn);
+            $rowTab = $this->mprocResolveListTabForRow($row, is_array($poRow) ? $poRow : null, $effectiveSn);
             if ($rowTab !== '' && $rowTab !== $tab) {
                 return $bundle;
             }
         }
         $row['status_name'] = $effectiveSn;
-        $row['mproc_can_edit'] = $this->mprocCanEditRow($user, $row) ? 1 : 0;
+        $listTab = $this->mprocResolveListTabForRow($row, is_array($poRow) ? $poRow : null, $effectiveSn);
+        $row['mproc_list_tab'] = $listTab;
+        $row['mproc_deadline_reached'] = $this->mprocIsQuoteDeadlineReachedForPo($poRow) ? 1 : 0;
+        $row['mproc_pick_result'] = $this->mprocResolvePickResultText($row, $poRow);
+        if ($row['mproc_pick_result'] === '' && $listTab === 'done' && $row['mproc_deadline_reached']) {
+            $row['mproc_done_label'] = '已截止';
+        } elseif ($row['mproc_pick_result'] !== '') {
+            $row['mproc_done_label'] = $row['mproc_pick_result'];
+        } else {
+            $row['mproc_done_label'] = '';
+        }
+        $row['mproc_can_edit'] = $this->mprocCanEditRow($user, $row, $poRow) ? 1 : 0;
         $am = $row['amount'] ?? null;
         $row['amount_display'] = ($am === null || $am === '' || (is_string($am) && trim($am) === '')) ? '' : (is_scalar($am) ? (string)$am : '');
         $dv = isset($row['delivery']) ? trim((string)$row['delivery']) : '';
@@ -1548,6 +1768,7 @@ class Index extends Frontend
         $row['mproc_this_quantity_display'] = $this->mprocResolveDisplayThisQuantity($row);
         array_unshift($rows, $row);
         $bundle['rows'] = $rows;
+        $bundle['groups'] = $this->mprocGroupRowsByOrder($rows);
 
         return $bundle;
     }
@@ -1806,6 +2027,7 @@ class Index extends Frontend
             $bundle = $this->mprocEnsureFocusRowInList($bundle, $mprocFocusEid, $user, $statusNameCol, $tab, $q);
         }
         $this->view->assign('rows', $bundle['rows']);
+        $this->view->assign('groups', $bundle['groups'] ?? $this->mprocGroupRowsByOrder($bundle['rows']));
 
         return $this->view->fetch();
     }
@@ -2090,7 +2312,7 @@ class Index extends Frontend
      * 是否允许当前登录用户修改该条 purchase_order_detail 的金额、交期
      * 仅普通用户(customer)可改;管理员(admin)仅可查看
      */
-    protected function mprocCanEditRow(array $user, array $row)
+    protected function mprocCanEditRow(array $user, array $row, ?array $po = null)
     {
         if (!empty($user['is_admin'])) {
             return false;
@@ -2099,6 +2321,9 @@ class Index extends Frontend
         if (in_array($sn, ['已完成', '未通过', '已废弃'], true)) {
             return false;
         }
+        if ($this->mprocIsQuoteDeadlineReachedForPo($po)) {
+            return false;
+        }
         $uCo = trim((string)($user['company_name'] ?? ''));
         if ($uCo === '') {
             $uPhone = trim((string)($user['phone'] ?? ''));
@@ -2158,20 +2383,18 @@ class Index extends Frontend
     }
 
     /**
-     * 保存单条协助明细的金额、交期(POST:id、amount、delivery)
+     * 保存单条协助明细的金额、交期(内部)
+     *
+     * @param array<string, mixed> $user
+     * @param int                  $id
+     * @param string               $amountRaw
+     * @param string               $deliveryRaw
+     * @return string 工序名(用于批量错误提示)
      */
-    public function mprocSave()
+    protected function mprocSaveDetailQuote(array $user, int $id, string $amountRaw, string $deliveryRaw): string
     {
-        if (!$this->request->isPost()) {
-            $this->error('请使用 POST');
-        }
-        $user = $this->mprocGetUser();
-        if (!$user) {
-            $this->error('请先登录', url('index/index/login'));
-        }
-        $id = (int)$this->request->post('id', 0);
         if ($id <= 0) {
-            $this->error('参数错误');
+            throw new \InvalidArgumentException('参数错误');
         }
         $row = null;
         try {
@@ -2183,8 +2406,9 @@ class Index extends Frontend
             $row = null;
         }
         if (!$row || !is_array($row)) {
-            $this->error('记录不存在');
+            throw new \InvalidArgumentException('记录不存在');
         }
+        $gymc = trim((string)($row['CGYMC'] ?? $row['cgymc'] ?? ''));
         $sid = (int)($row['scydgy_id'] ?? $row['SCYDGY_ID'] ?? 0);
         $po = null;
         if ($this->mprocIsValidScydgyRowId($sid)) {
@@ -2193,38 +2417,48 @@ class Index extends Frontend
             } catch (\Throwable $e) {
                 $po = null;
             }
+            if (is_array($po)) {
+                $this->mprocMergePurchaseOrderIntoDetail($row, $po);
+                if ($gymc === '') {
+                    $gymc = trim((string)($row['CGYMC'] ?? ''));
+                }
+            }
         }
+        $label = $gymc !== '' ? ('工序「' . $gymc . '」') : ('记录#' . $id);
         $effectiveSn = $this->mprocResolveEffectiveStatusName($row, is_array($po) ? $po : null);
         if (in_array($effectiveSn, ['已完成', '未通过', '已废弃'], true)) {
-            $this->error('订单已结束,不能再修改单价与交货日期');
+            throw new \InvalidArgumentException($label . '已结束,不能再修改');
         }
-        if (!$this->mprocCanEditRow($user, array_merge($row, ['status_name' => $effectiveSn]))) {
+        if ($this->mprocIsQuoteDeadlineReachedForPo(is_array($po) ? $po : null)) {
+            throw new \InvalidArgumentException($label . '报价已截止,不能再修改');
+        }
+        if (!$this->mprocCanEditRow($user, array_merge($row, ['status_name' => $effectiveSn]), is_array($po) ? $po : null)) {
             if (!empty($user['is_admin'])) {
-                $this->error('当前账号仅可查看,不能修改单价与交货日期');
+                throw new \InvalidArgumentException('当前账号仅可查看,不能修改单价与交货日期');
             }
-            $this->error('无权修改该记录');
+            throw new \InvalidArgumentException($label . '无权修改');
         }
 
-        $amountRaw = trim((string)$this->request->post('amount', ''));
-        $deliveryRaw = trim((string)$this->request->post('delivery', ''));
-
+        $amountRaw = trim($amountRaw);
+        $deliveryRaw = trim($deliveryRaw);
         $data = [];
         if ($amountRaw === '') {
             $data['amount'] = null;
         } else {
             if (!preg_match('/^-?\d+(\.\d{1,5})?$/', $amountRaw)) {
-                $this->error('单价格式不正确,最多五位小数');
+                throw new \InvalidArgumentException($label . '单价格式不正确,最多五位小数');
             }
             $ceilingLimit = $this->mprocResolveCeilingPriceForDetailRow($row);
             if ($ceilingLimit !== null && (float)$amountRaw > $ceilingLimit) {
-                $this->error('单价不能超过最高限价 ' . $this->mprocFormatCeilingPriceDisplay($ceilingLimit));
+                throw new \InvalidArgumentException(
+                    $label . '单价不能超过最高限价 ' . $this->mprocFormatCeilingPriceDisplay($ceilingLimit)
+                );
             }
             $data['amount'] = $amountRaw;
         }
         if ($deliveryRaw === '') {
             $data['delivery'] = null;
         } elseif (preg_match('/^\d{4}-\d{2}-\d{2}$/', $deliveryRaw)) {
-            // 仅选年月日:存 DATETIME,禁止写成 00:00:00——原记录有非零点时间则沿用,否则用当前服务器时分秒
             $existingDel = isset($row['delivery']) ? trim((string)$row['delivery']) : '';
             $timePart = date('H:i:s');
             if ($existingDel !== '') {
@@ -2241,7 +2475,7 @@ class Index extends Frontend
             $deliveryRaw = str_replace('T', ' ', $deliveryRaw);
             $ts = strtotime($deliveryRaw);
             if ($ts === false) {
-                $this->error('交期时间格式不正确');
+                throw new \InvalidArgumentException($label . '交期时间格式不正确');
             }
             $data['delivery'] = date('Y-m-d H:i:s', $ts);
         }
@@ -2254,7 +2488,6 @@ class Index extends Frontend
             $data[$upCol] = date('Y-m-d H:i:s');
         }
 
-        // 同步 status_name(与列表 Tab 一致):金额或交期任一有有效数据 → 已提交,否则未提交;已是「已完成」不覆盖
         $statusNameCol = $this->mprocResolveProcuremenColumn(['status_name', 'status_txt', 'status_text']);
         if ($statusNameCol !== null) {
             $curSn = '';
@@ -2282,12 +2515,210 @@ class Index extends Frontend
             if (stripos($msg, 'Unknown column') !== false) {
                 $msg = '请确认数据表 purchase_order_detail 已包含 amount、delivery 字段';
             }
-            $this->error('保存失败:' . $msg);
+            throw new \RuntimeException('保存失败:' . $msg);
         }
         if ($aff === false) {
-            $this->error('保存失败');
+            throw new \RuntimeException($label . '保存失败');
+        }
+
+        return $gymc;
+    }
+
+    /**
+     * 保存同订单号+供应商下的整单备注(写入该组全部明细行)
+     *
+     * @param array<string, mixed> $user
+     * @param int[]                $detailIds 本次保存涉及的明细 ID
+     * @param string               $remarkRaw
+     */
+    protected function mprocSaveOrderGroupRemark(array $user, array $detailIds, string $remarkRaw): void
+    {
+        $remarkCol = $this->mprocResolveProcuremenColumn(['remark', 'memo', 'bz', 'beizhu']);
+        if ($remarkCol === null) {
+            return;
+        }
+        $detailIds = array_values(array_unique(array_filter(array_map('intval', $detailIds))));
+        if ($detailIds === []) {
+            return;
+        }
+        $anchorId = $detailIds[0];
+        $row = null;
+        try {
+            $row = Db::table('purchase_order_detail')->where('id', $anchorId)->find();
+            if (!$row) {
+                $row = Db::table('purchase_order_detail')->where('ID', $anchorId)->find();
+            }
+        } catch (\Throwable $e) {
+            $row = null;
+        }
+        if (!$row || !is_array($row)) {
+            throw new \InvalidArgumentException('记录不存在');
+        }
+        $sid = (int)($row['scydgy_id'] ?? $row['SCYDGY_ID'] ?? 0);
+        $po = null;
+        if ($this->mprocIsValidScydgyRowId($sid)) {
+            try {
+                $po = Db::table('purchase_order')->where('scydgy_id', $sid)->find();
+            } catch (\Throwable $e) {
+                $po = null;
+            }
+            if (is_array($po)) {
+                $this->mprocMergePurchaseOrderIntoDetail($row, $po);
+            }
+        }
+        $effectiveSn = $this->mprocResolveEffectiveStatusName($row, is_array($po) ? $po : null);
+        if (in_array($effectiveSn, ['已完成', '未通过', '已废弃'], true)) {
+            throw new \InvalidArgumentException('订单已结束,不能再修改备注');
+        }
+        if ($this->mprocIsQuoteDeadlineReachedForPo(is_array($po) ? $po : null)) {
+            throw new \InvalidArgumentException('报价已截止,不能再修改备注');
+        }
+        if (!$this->mprocCanEditRow($user, array_merge($row, ['status_name' => $effectiveSn]), is_array($po) ? $po : null)) {
+            if (!empty($user['is_admin'])) {
+                throw new \InvalidArgumentException('当前账号仅可查看,不能修改备注');
+            }
+            throw new \InvalidArgumentException('无权修改备注');
+        }
+
+        $ccydhCol = $this->mprocResolveProcuremenColumn(['ccydh']);
+        $companyCol = $this->mprocResolveProcuremenColumn(['company_name']);
+        if ($ccydhCol === null || $companyCol === null) {
+            return;
         }
-        $this->success('已保存');
+        $ccydh = '';
+        $company = '';
+        foreach ($row as $k => $v) {
+            if (strcasecmp((string)$k, $ccydhCol) === 0) {
+                $ccydh = trim((string)$v);
+            } elseif (strcasecmp((string)$k, $companyCol) === 0) {
+                $company = trim((string)$v);
+            }
+        }
+        if ($ccydh === '' || $company === '') {
+            $pkField = isset($row['id']) ? 'id' : (isset($row['ID']) ? 'ID' : 'id');
+            $data = [$remarkCol => ($remarkRaw === '' ? null : mb_substr($remarkRaw, 0, 500, 'UTF-8'))];
+            $upCol = $this->mprocResolveProcuremenColumn(['updatetime']);
+            if ($upCol !== null) {
+                $data[$upCol] = date('Y-m-d H:i:s');
+            }
+            Db::table('purchase_order_detail')->where($pkField, (int)($row[$pkField] ?? $anchorId))->update($data);
+
+            return;
+        }
+
+        $remarkVal = $remarkRaw === '' ? null : mb_substr($remarkRaw, 0, 500, 'UTF-8');
+        $data = [$remarkCol => $remarkVal];
+        $upCol = $this->mprocResolveProcuremenColumn(['updatetime']);
+        if ($upCol !== null) {
+            $data[$upCol] = date('Y-m-d H:i:s');
+        }
+        $query = Db::table('purchase_order_detail')
+            ->where($ccydhCol, $ccydh)
+            ->where($companyCol, $company);
+        $userWhere = $this->mprocListWhereForLoginUser($user);
+        if ($userWhere !== []) {
+            $query->where($userWhere);
+        }
+        try {
+            $query->update($data);
+        } catch (\Throwable $e) {
+            throw new \RuntimeException('备注保存失败:' . $e->getMessage());
+        }
+    }
+
+    /**
+     * 保存协助明细金额、交期
+     * 单条:POST id、amount、delivery
+     * 批量:POST items=[{id,amount,delivery},...] JSON
+     */
+    public function mprocSave()
+    {
+        if (!$this->request->isPost()) {
+            $this->error('请使用 POST');
+        }
+        $user = $this->mprocGetUser();
+        if (!$user) {
+            $this->error('请先登录', url('index/index/login'));
+        }
+
+        // Frontend 默认 filter 含 htmlspecialchars,会把 JSON 的双引号变成 &quot; 导致解析失败
+        $itemsRaw = $this->request->post('items', '', null);
+        if ($itemsRaw === '' || $itemsRaw === null) {
+            $itemsRaw = isset($_POST['items']) ? $_POST['items'] : '';
+        }
+        if (is_string($itemsRaw) && $itemsRaw !== '' && strpos($itemsRaw, '&quot;') !== false) {
+            $itemsRaw = htmlspecialchars_decode($itemsRaw, ENT_QUOTES);
+        }
+        $items = [];
+        if (is_string($itemsRaw) && trim($itemsRaw) !== '') {
+            $decoded = json_decode($itemsRaw, true);
+            if (!is_array($decoded)) {
+                $decoded = json_decode(htmlspecialchars_decode($itemsRaw, ENT_QUOTES), true);
+            }
+            if (is_array($decoded)) {
+                $items = $decoded;
+            }
+        } elseif (is_array($itemsRaw)) {
+            $items = $itemsRaw;
+        }
+
+        if ($items === []) {
+            $id = (int)$this->request->post('id', 0, null);
+            if ($id <= 0) {
+                $this->error('保存失败,请关闭弹窗后重试');
+            }
+            $items = [[
+                'id'       => $id,
+                'amount'   => (string)$this->request->post('amount', '', null),
+                'delivery' => (string)$this->request->post('delivery', '', null),
+            ]];
+        }
+
+        $saved = 0;
+        $savedIds = [];
+        $remarkRaw = $this->request->post('remark', '', null);
+        if ($remarkRaw === '' || $remarkRaw === null) {
+            $remarkRaw = isset($_POST['remark']) ? $_POST['remark'] : '';
+        }
+        $remarkRaw = trim(htmlspecialchars_decode((string)$remarkRaw, ENT_QUOTES));
+        Db::startTrans();
+        try {
+            foreach ($items as $it) {
+                if (!is_array($it)) {
+                    continue;
+                }
+                $id = (int)($it['id'] ?? $it['eid'] ?? 0);
+                if ($id <= 0) {
+                    continue;
+                }
+                $delivery = (string)($it['delivery'] ?? '');
+                // 兼容部分手机浏览器把日期显示/提交成 2026/07/24
+                if (preg_match('/^(\d{4})[\/.\-](\d{1,2})[\/.\-](\d{1,2})$/', trim($delivery), $dm)) {
+                    $delivery = sprintf('%04d-%02d-%02d', (int)$dm[1], (int)$dm[2], (int)$dm[3]);
+                }
+                $this->mprocSaveDetailQuote(
+                    $user,
+                    $id,
+                    (string)($it['amount'] ?? ''),
+                    $delivery
+                );
+                $saved++;
+                $savedIds[] = $id;
+            }
+            if ($saved < 1) {
+                throw new \InvalidArgumentException('没有可保存的工序,请刷新后重试');
+            }
+            $this->mprocSaveOrderGroupRemark($user, $savedIds, $remarkRaw);
+            Db::commit();
+        } catch (\InvalidArgumentException $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        } catch (\Throwable $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+
+        $this->success($saved > 1 ? ('已保存 ' . $saved . ' 道工序') : '已保存');
     }
 
     /**

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 651 - 210
application/index/view/index/index.html


+ 7 - 13
public/assets/css/xinhua-theme.css

@@ -570,18 +570,17 @@ body.inside-aside .content,
 
 .bootstrap-table .table,
 .table {
-    border: none !important;
-    border-color: transparent !important;
+    border: 1px solid #e4e7ed !important;
+    border-color: #e4e7ed !important;
 }
 
-/* 参考样式:浅灰表头、仅横线分隔、无竖线
+/* 浅灰表头 + 完整单元格边框(含竖线)
  * 注意:bootstrap-table 表头 padding 只能加在 .th-inner 上,勿同时给 th 加 padding,否则表头色条与文字错位 */
 .bootstrap-table .table > thead > tr > th,
 .table > thead > tr > th {
     background: #f5f7fa !important;
     color: #303133 !important;
-    border: none !important;
-    border-bottom: 1px solid #e4e7ed !important;
+    border: 1px solid #e4e7ed !important;
     font-weight: 600;
     font-size: 13px;
 }
@@ -599,11 +598,7 @@ body.inside-aside .content,
 
 .bootstrap-table .table > tbody > tr > td,
 .table > tbody > tr > td {
-    border: none !important;
-    border-bottom: 1px solid #ebeef5 !important;
-    border-left: none !important;
-    border-right: none !important;
-    border-top: none !important;
+    border: 1px solid #ebeef5 !important;
     color: #606266;
     font-size: 13px;
     background-color: #ffffff !important;
@@ -617,14 +612,13 @@ body.inside-aside .content,
 
 .bootstrap-table .table-bordered,
 .table-bordered {
-    border: none !important;
+    border: 1px solid #e4e7ed !important;
 }
 .bootstrap-table .table-bordered > thead > tr > th,
 .bootstrap-table .table-bordered > tbody > tr > td,
 .table-bordered > thead > tr > th,
 .table-bordered > tbody > tr > td {
-    border-left: none !important;
-    border-right: none !important;
+    border: 1px solid #e4e7ed !important;
 }
 
 /* 取消斑马纹:全部白底 */

+ 54 - 6
public/assets/js/backend/procuremen.js

@@ -894,8 +894,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             return '';
                         }
                         var areaDetails = ' data-area=\'["92%","88%"]\'';
-                        var areaAudit = ' data-area=\'["96%","88%"]\'';
-                        var areaConfirmOutward = ' data-area=\'["96%","88%"]\'';
+                        var areaAudit = ' data-area=\'["98%","92%"]\'';
+                        var areaConfirmOutward = ' data-area=\'["98%","92%"]\'';
                         var parts = [];
                         if (tab === 'pick') {
                             return '';
@@ -1872,19 +1872,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         if (button && button.layerArea && button.layerArea.length) {
                             layerOpts.area = button.layerArea;
                         }
+                        // 审批弹窗必须大屏展示(忽略 data-area / 默认 800px)
+                        layerOpts.area = ['98%', '92%'];
                         var winName = $a.data('window') || 'self';
                         var win = window[winName] || window;
                         if (!win.Backend || !win.Backend.api) {
                             Toastr.error('Backend 未就绪,请刷新页面');
                             return;
                         }
+                        var openLayerOpts = {
+                            area: ['98%', '92%']
+                        };
+                        if (typeof layerOpts.callback === 'function') {
+                            openLayerOpts.callback = layerOpts.callback;
+                        }
                         if (typeof layerOpts.confirm !== 'undefined') {
                             Layer.confirm(layerOpts.confirm, function (index) {
-                                win.Backend.api.open(outUrl, title, layerOpts);
+                                win.Backend.api.open(outUrl, title, openLayerOpts);
                                 Layer.close(index);
                             });
                         } else {
-                            win.Backend.api.open(outUrl, title, layerOpts);
+                            win.Backend.api.open(outUrl, title, openLayerOpts);
                         }
                         return;
                     }
@@ -1907,7 +1915,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         }
                         var winA = window;
                         if (winA.Backend && winA.Backend.api) {
-                            winA.Backend.api.open(auditUrl, '供应商报价明细', {area: ['96%', '88%']});
+                            winA.Backend.api.open(auditUrl, '供应商报价明细', {area: ['98%', '92%']});
                         }
                         return;
                     }
@@ -2186,7 +2194,47 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         },
 
         add: function () {
-            Controller.api.bindevent();
+            var defaultCclbmmc = '营销中心';
+            var $form = $('#add-form');
+            var $cclbmmc = $form.find('[name="row[CCLBMMC]"]');
+            if ($cclbmmc.length && !$.trim($cclbmmc.val() || '')) {
+                $cclbmmc.val(defaultCclbmmc);
+            }
+            Form.api.bindevent($form, function (data, ret) {
+                var msg = ret && ret.msg ? ret.msg : '新增成功';
+                if (typeof Toastr !== 'undefined') {
+                    Toastr.success(msg);
+                } else if (parent.Toastr) {
+                    parent.Toastr.success(msg);
+                }
+                // 新增成功后跳转「业务员查询询价」
+                var jumpUrl = 'procuremen/rfqlist';
+                var jumpTitle = '业务员查询询价';
+                try {
+                    var api = (top.Backend && top.Backend.api) ? top.Backend.api
+                        : ((parent.Backend && parent.Backend.api) ? parent.Backend.api : null);
+                    if (api && typeof api.addtabs === 'function') {
+                        api.addtabs(jumpUrl, jumpTitle);
+                        setTimeout(function () {
+                            try {
+                                top.$('.content-wrapper .btn-refresh').trigger('click');
+                            } catch (eRefresh) {
+                            }
+                        }, 400);
+                        if (typeof api.closetabs === 'function') {
+                            try {
+                                api.closetabs(Fast.api.fixurl('procuremen/add'));
+                            } catch (eClose) {
+                            }
+                        }
+                    } else {
+                        location.href = Fast.api.fixurl(jumpUrl);
+                    }
+                } catch (eJump) {
+                    location.href = Fast.api.fixurl(jumpUrl);
+                }
+                return false;
+            });
         },
         edit: function () {
             Controller.api.bindevent();

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

@@ -63,6 +63,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 search: true,
                 pagination: true,
                 smartDisplay: false,
+                clickToSelect: false,
                 pageSize: Config.pagesize || localStorage.getItem('pagesize') || 20,
                 pageList: [10, 15, 20, 25, 50],
                 showJumpto: true,

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