|
|
@@ -1243,6 +1243,20 @@ class Procuremen extends Backend
|
|
|
}
|
|
|
}
|
|
|
$quoteBucket = $this->loadQuotedSupplierBucketByScydgyIds(array_keys($idList));
|
|
|
+ $bidOpenSet = [];
|
|
|
+ if ($wffTab === 'audit') {
|
|
|
+ $ccydhList = [];
|
|
|
+ foreach ($rows as $rw0) {
|
|
|
+ if (!is_array($rw0)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $c0 = trim((string)($rw0['CCYDH'] ?? ''));
|
|
|
+ if ($c0 !== '') {
|
|
|
+ $ccydhList[] = $c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $bidOpenSet = $this->loadProcuremenBidOpenVerifiedCcydhSet($ccydhList);
|
|
|
+ }
|
|
|
foreach ($rows as &$rw) {
|
|
|
if (!is_array($rw)) {
|
|
|
continue;
|
|
|
@@ -1273,6 +1287,10 @@ class Procuremen extends Backend
|
|
|
$rw['picked_supplier_name'] = $supplierText;
|
|
|
} else {
|
|
|
$rw['notify_supplier_text'] = $supplierText;
|
|
|
+ $ccydh = trim((string)($rw['CCYDH'] ?? ''));
|
|
|
+ $verified = ($ccydh !== '' && isset($bidOpenSet[$ccydh]));
|
|
|
+ $rw['bid_open_verified'] = $verified ? 1 : 0;
|
|
|
+ $rw['bid_open_status_text'] = $verified ? '已开标' : '待开标';
|
|
|
}
|
|
|
}
|
|
|
unset($rw);
|
|
|
@@ -2000,6 +2018,64 @@ class Procuremen extends Backend
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量查询订单是否已开标验证
|
|
|
+ *
|
|
|
+ * @param array<int, string> $ccydhs
|
|
|
+ * @return array<string, bool> ccydh => true
|
|
|
+ */
|
|
|
+ protected function loadProcuremenBidOpenVerifiedCcydhSet(array $ccydhs): array
|
|
|
+ {
|
|
|
+ $set = [];
|
|
|
+ $list = [];
|
|
|
+ foreach ($ccydhs as $c) {
|
|
|
+ $c = trim((string)$c);
|
|
|
+ if ($c !== '') {
|
|
|
+ $list[$c] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($list === []) {
|
|
|
+ return $set;
|
|
|
+ }
|
|
|
+ $this->ensurePurchaseOrderBidOpenTable();
|
|
|
+ try {
|
|
|
+ $rows = Db::table('purchase_order_bid_open')
|
|
|
+ ->where('ccydh', 'in', array_keys($list))
|
|
|
+ ->field('ccydh')
|
|
|
+ ->select();
|
|
|
+ foreach ($rows as $row) {
|
|
|
+ if (!is_array($row)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $c = trim((string)($row['ccydh'] ?? ''));
|
|
|
+ if ($c !== '') {
|
|
|
+ $set[$c] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (\Throwable $e) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ return $set;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 未开标验证时掩码供应商备注(与单价/交货日期一致)
|
|
|
+ *
|
|
|
+ * @param array<string, mixed> $group
|
|
|
+ */
|
|
|
+ protected function maskSupplierRemarkBeforeBidOpen(array &$group, bool $quoteVisible): void
|
|
|
+ {
|
|
|
+ $remarkRaw = trim((string)($group['remark'] ?? ''));
|
|
|
+ if ($quoteVisible || $remarkRaw === '') {
|
|
|
+ $group['remark_quote_pending'] = 0;
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $group['remark'] = '开标验证后查看';
|
|
|
+ $group['remark_quote_pending'] = 1;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param array{ccydh?:string} $bundle
|
|
|
*/
|
|
|
@@ -2553,6 +2629,7 @@ class Procuremen extends Backend
|
|
|
$byCompany[$cn]['line_count'] = $total;
|
|
|
$byCompany[$cn]['has_total'] = $total > 0;
|
|
|
$byCompany[$cn]['has_remark'] = $total > 0;
|
|
|
+ $this->maskSupplierRemarkBeforeBidOpen($byCompany[$cn], $quoteVisible);
|
|
|
$byCompany[$cn]['total_text'] = ($quoteVisible && $groupHasTotal) ? $this->formatProcuremenMoneyDisplay($groupTotal) : '';
|
|
|
// 工序行 + 备注行 + 总计行
|
|
|
$byCompany[$cn]['display_rowspan'] = $total > 0 ? ($total + 2) : 0;
|
|
|
@@ -2755,6 +2832,7 @@ class Procuremen extends Backend
|
|
|
$g['line_count'] = $lineCount;
|
|
|
$g['has_total'] = $lineCount > 0;
|
|
|
$g['has_remark'] = $lineCount > 0;
|
|
|
+ $this->maskSupplierRemarkBeforeBidOpen($g, $quoteVisible);
|
|
|
$g['total_text'] = ($quoteVisible && $groupHasTotal) ? $this->formatProcuremenMoneyDisplay($groupTotal) : '';
|
|
|
// 工序行 + 备注行 + 总计行
|
|
|
$g['display_rowspan'] = $lineCount > 0 ? ($lineCount + 2) : 0;
|
|
|
@@ -5541,7 +5619,7 @@ class Procuremen extends Backend
|
|
|
}
|
|
|
$lineCount = count($lines);
|
|
|
$hasRemark = $lineCount > 0;
|
|
|
- $supplierGroups[] = [
|
|
|
+ $supplierGroup = [
|
|
|
'company_name' => $cn,
|
|
|
'username' => $username,
|
|
|
'email' => is_array($firstDetail) ? trim((string)($firstDetail['email'] ?? '')) : '',
|
|
|
@@ -5556,6 +5634,8 @@ class Procuremen extends Backend
|
|
|
'total_text' => ($quoteVisible && $groupHas) ? $this->formatProcuremenMoneyDisplay($groupTotal) : '',
|
|
|
'has_total' => $lineCount > 0,
|
|
|
];
|
|
|
+ $this->maskSupplierRemarkBeforeBidOpen($supplierGroup, $quoteVisible);
|
|
|
+ $supplierGroups[] = $supplierGroup;
|
|
|
}
|
|
|
usort($supplierGroups, function ($a, $b) {
|
|
|
if (($a['is_void'] ?? false) !== ($b['is_void'] ?? false)) {
|