m0_70156489 1 долоо хоног өмнө
parent
commit
012e9b1624

+ 33 - 6
application/admin/controller/Procuremen.php

@@ -1927,9 +1927,9 @@ class Procuremen extends Backend
         $line['subtotal_text'] = $amountFilled ? '未到截止时间' : '';
         $line['subtotal_num'] = null;
 
-        $line['amount_quote_pending'] = $amountFilled;
-        $line['delivery_quote_pending'] = $deliveryFilled;
-        $line['quote_before_deadline'] = $amountFilled || $deliveryFilled;
+        $line['amount_quote_pending'] = $amountFilled ? 1 : 0;
+        $line['delivery_quote_pending'] = $deliveryFilled ? 1 : 0;
+        $line['quote_before_deadline'] = ($amountFilled || $deliveryFilled) ? 1 : 0;
         $line['amount_filled'] = false;
         $line['delivery_filled'] = false;
         $line['is_quoted'] = false;
@@ -1938,6 +1938,33 @@ class Procuremen extends Backend
         }
     }
 
+    /**
+     * 报价行展示字段默认值(模板安全访问)
+     *
+     * @param array<string, mixed> $line
+     * @return array<string, mixed>
+     */
+    protected function ensureSupplierQuoteLineDisplayKeys(array $line): array
+    {
+        if (!array_key_exists('amount_quote_pending', $line)) {
+            $line['amount_quote_pending'] = 0;
+        }
+        if (!array_key_exists('delivery_quote_pending', $line)) {
+            $line['delivery_quote_pending'] = 0;
+        }
+        if (!array_key_exists('quote_before_deadline', $line)) {
+            $line['quote_before_deadline'] = 0;
+        }
+        if (!array_key_exists('amount_filled', $line)) {
+            $line['amount_filled'] = 0;
+        }
+        if (!array_key_exists('delivery_filled', $line)) {
+            $line['delivery_filled'] = 0;
+        }
+
+        return $line;
+    }
+
     /**
      * 审核弹窗:按供应商汇总报价明细
      *
@@ -2070,7 +2097,7 @@ class Procuremen extends Backend
             if (!$deadlineReached) {
                 $this->maskSupplierQuoteLineBeforeDeadline($lineRow);
             }
-            $byCompany[$cn]['lines'][] = $lineRow;
+            $byCompany[$cn]['lines'][] = $this->ensureSupplierQuoteLineDisplayKeys($lineRow);
         }
         foreach ($byCompany as $cn => $g) {
             $total = count($g['lines']);
@@ -2236,7 +2263,7 @@ class Procuremen extends Backend
             if (!$deadlineReached) {
                 $this->maskSupplierQuoteLineBeforeDeadline($pickLine);
             }
-            $byCompany[$cn]['pick_lines'][$sid] = $pickLine;
+            $byCompany[$cn]['pick_lines'][$sid] = $this->ensureSupplierQuoteLineDisplayKeys($pickLine);
             $byCompany[$cn]['detail_picks'][$sid] = [
                 'scydgy_id'         => $sid,
                 'detail_id'         => $detailId,
@@ -4722,7 +4749,7 @@ class Procuremen extends Backend
                     $groupTotal += $sub;
                     $groupHas = true;
                 }
-                $lines[] = $line;
+                $lines[] = $this->ensureSupplierQuoteLineDisplayKeys($line);
             };
             foreach ($orderedSids as $sid) {
                 if (!isset($bySid[$sid])) {

+ 3 - 3
application/admin/view/procuremen/audit_issue.html

@@ -249,9 +249,9 @@
                 <td{if condition="$co.display_rowspan gt 1"} rowspan="{$co.display_rowspan}"{/if} style="vertical-align:middle;">{$co.phone|default=''|htmlentities}</td>
                 {/if}
                 <td>{$ln.cgymc|default=''|htmlentities}</td>
-                <td class="text-center{if condition="$ln.amount_quote_pending eq 1"} audit-quote-pending{elseif condition="$ln.amount_filled neq 1"} audit-quote-empty{/if}">{$ln.unit_price_text|default='未填写'|htmlentities}</td>
-                <td class="text-center{if condition="$ln.delivery_quote_pending eq 1"} audit-quote-pending{elseif condition="$ln.delivery_filled neq 1"} audit-quote-empty{/if}">{$ln.delivery_show|default='未填写'|htmlentities}</td>
-                <td class="text-center{if condition="$ln.amount_quote_pending eq 1"} audit-quote-pending{/if}">{$ln.subtotal_text|default=''|htmlentities}</td>
+                <td class="text-center{if condition="!empty($ln.amount_quote_pending)"} audit-quote-pending{elseif condition="$ln.amount_filled neq 1"} audit-quote-empty{/if}">{$ln.unit_price_text|default='未填写'|htmlentities}</td>
+                <td class="text-center{if condition="!empty($ln.delivery_quote_pending)"} audit-quote-pending{elseif condition="$ln.delivery_filled neq 1"} audit-quote-empty{/if}">{$ln.delivery_show|default='未填写'|htmlentities}</td>
+                <td class="text-center{if condition="!empty($ln.amount_quote_pending)"} audit-quote-pending{/if}">{$ln.subtotal_text|default=''|htmlentities}</td>
                 {if $lk == 1}
                 <td class="text-center audit-op-cell"{if condition="$co.display_rowspan gt 1"} rowspan="{$co.display_rowspan}"{/if} style="vertical-align:middle;">
                     {if $auth->check('procuremen/auditresendemail')}

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

@@ -215,8 +215,8 @@
                 <td{if condition="$co.display_rowspan gt 1"} rowspan="{$co.display_rowspan}"{/if} style="vertical-align:middle;">{$co.phone|default=''|htmlentities}</td>
                 {/if}
                 <td>{$ql.cgymc|default=''|htmlentities}</td>
-                <td class="text-center{if condition="$ql.amount_quote_pending eq 1"} 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="$ql.delivery_quote_pending eq 1"} outward-quote-empty{elseif condition="$ql.delivery_filled neq 1"} outward-quote-empty{/if}">{$ql.delivery_text|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}