Show per-item company on multi-company order pricing and detail.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-15 08:52:58 +02:00
co-authored by Cursor
parent 9d76af8963
commit bc4123e91c
3 changed files with 14 additions and 0 deletions
+2
View File
@@ -76,6 +76,8 @@ export interface OrderItem {
confirmedMeterage: number | null
supplyPrice: number | null
totalAmount: number | null
companyId?: string
companyName?: string
}
export interface Order {
+9
View File
@@ -71,6 +71,8 @@ async function loadOrder() {
confirmedMeterage: item.confirmedMeterage,
supplyPrice: item.supplyPrice,
totalAmount: item.totalAmount,
companyId: item.companyId,
companyName: item.companyName,
}))
shippingCost.value = data.shippingCost ?? 0
} catch (err) {
@@ -129,6 +131,8 @@ function submitAddProduct() {
confirmedMeterage: form.confirmedMeterage || form.requestedMeterage,
supplyPrice: null,
totalAmount: null,
companyId: order.value?.companyId,
companyName: order.value?.companyName,
})
closeAddModal()
@@ -163,6 +167,8 @@ async function savePricing() {
confirmedMeterage: item.confirmedMeterage,
supplyPrice: item.supplyPrice,
totalAmount: item.totalAmount,
companyId: item.companyId,
companyName: item.companyName,
}))
toast.success('قیمت‌گذاری ذخیره شد.')
} catch (err) {
@@ -270,6 +276,7 @@ async function sendInvoice() {
<thead>
<tr>
<th>ردیف</th>
<th>شرکت</th>
<th>کالیته</th>
<th>محصول</th>
<th>رنگ / نوع</th>
@@ -283,6 +290,7 @@ async function sendInvoice() {
<tbody>
<tr v-for="(item, index) in items" :key="item.id">
<td>{{ index + 1 }}</td>
<td>{{ item.companyName || order?.companyName || '—' }}</td>
<td>{{ item.catalogCode }}</td>
<td>{{ item.productName }}</td>
<td>{{ item.color }}</td>
@@ -328,6 +336,7 @@ async function sendInvoice() {
<span class="pricing-page__item-index">#{{ index + 1 }}</span>
</div>
<div class="admin-card-item__meta">
<span v-if="item.companyName || order?.companyName">{{ item.companyName || order?.companyName }}</span>
<span>کالیته {{ item.catalogCode }}</span>
<span>{{ item.color }}</span>
<span>درخواست: {{ formatNumber(item.requestedMeterage) }} متر</span>
@@ -213,6 +213,7 @@ function submitStatus() {
<table class="admin-table admin-table--compact">
<thead>
<tr>
<th>شرکت</th>
<th>کالیته</th>
<th>محصول</th>
<th>رنگ</th>
@@ -223,6 +224,7 @@ function submitStatus() {
</thead>
<tbody>
<tr v-for="item in order.items" :key="item.id">
<td>{{ item.companyName || order.companyName }}</td>
<td>{{ item.catalogCode }}</td>
<td>{{ item.productName }}</td>
<td>{{ item.color }}</td>
@@ -241,6 +243,7 @@ function submitStatus() {
<span>{{ item.catalogCode }}</span>
</div>
<div class="order-detail__item-meta">
<span v-if="item.companyName">{{ item.companyName }}</span>
<span>{{ item.color }}</span>
<span>{{ formatMeterage(item.confirmedMeterage ?? item.requestedMeterage) }}</span>
<span v-if="item.supplyPrice != null">{{ formatCurrency(item.supplyPrice) }}</span>