新增历史补单与服务中状态
This commit is contained in:
@@ -34,7 +34,7 @@ const formatMoney = (value?: number | string) => {
|
||||
const formatDateTime = (value?: string) => value ? String(value).replace('T', ' ').slice(0, 16) : '--'
|
||||
const isQuoteStatus = (status?: unknown) => Number(status) === 0
|
||||
const isQuoteConfirming = computed(() => isQuoteStatus(order.value?.status))
|
||||
const statusClass = (status?: number) => isQuoteStatus(status) ? 'quote' : status === 2 ? 'done' : status === 3 ? 'cancelled' : 'pending'
|
||||
const statusClass = (status?: number) => isQuoteStatus(status) ? 'quote' : status === 2 ? 'done' : status === 3 ? 'cancelled' : status === 4 ? 'in-service' : 'pending'
|
||||
const isOrderPaid = (target: any) => String(target?.paymentStatus || '').toUpperCase() === 'PAID'
|
||||
const canPreparePayment = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 1 && !isOrderPaid(order.value))
|
||||
const canMockPay = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 1 && String(order.value?.paymentStatus || '').toUpperCase() === 'PAYING')
|
||||
|
||||
@@ -31,7 +31,7 @@ const nodes = computed(() => {
|
||||
{ key: 'created', title: '订单创建', desc: formatTime(current.createTime), done: true, active: false },
|
||||
{ key: 'appointment', title: '预约确认', desc: formatTime(firstAppointment.value), done: Boolean(firstAppointment.value), active: status === 1 },
|
||||
{ key: 'artist', title: '服务安排', desc: latestChangeText.value, done: changes.value.length > 0 || items.value.some((item: any) => item.artistName), active: changes.value.some(item => item.status === 'PENDING') },
|
||||
{ key: 'service', title: status === 3 ? '订单取消' : '服务完成', desc: formatTime(current.completeTime || current.cancelTime || current.updateTime), done: status === 2 || status === 3, active: status === 2 || status === 3 },
|
||||
{ key: 'service', title: status === 3 ? '订单取消' : status === 4 ? '服务中' : '服务完成', desc: formatTime(current.completeTime || current.cancelTime || current.updateTime), done: status === 2 || status === 3, active: status === 2 || status === 3 || status === 4 },
|
||||
{ key: 'after-sale', title: '售后/评价', desc: afterSales.value.length ? `${afterSales.value.length} 条售后` : (reviews.value.length ? `${reviews.value.length} 条评价` : '暂无记录'), done: afterSales.value.length > 0 || reviews.value.length > 0, active: afterSales.value.some(item => item.status === 'PENDING') || reviews.value.some(item => !item.rating) }
|
||||
]
|
||||
})
|
||||
|
||||
@@ -108,6 +108,22 @@
|
||||
>
|
||||
取消订单
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="record.status === 4 && canProcessOrders"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="process(record.id, 2)"
|
||||
>
|
||||
完成补单
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="record.status === 4 && canProcessOrders && !isArtist"
|
||||
danger
|
||||
size="small"
|
||||
@click="process(record.id, 3)"
|
||||
>
|
||||
取消补单
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -175,6 +191,8 @@
|
||||
>
|
||||
取消
|
||||
</a-button>
|
||||
<a-button v-if="item.status === 4 && canProcessOrders" size="small" type="primary" @click="process(item.id, 2)">完成补单</a-button>
|
||||
<a-button v-if="item.status === 4 && canProcessOrders && !isArtist" size="small" danger @click="process(item.id, 3)">取消补单</a-button>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
@@ -195,6 +213,7 @@
|
||||
<a-descriptions-item label="实付金额">{{ formatMoney(currentOrder.actualAmount) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="优惠券">{{ currentOrder.couponName || '无' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="订单状态">{{ orderStatusText(currentOrder) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="订单来源">{{ currentOrder.orderSource === 'HISTORICAL_BACKFILL' ? '历史补单' : '正常订单' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间" :span="isMobile ? 1 : 2">{{ currentOrder.createTime }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
|
||||
@@ -496,7 +515,8 @@ const statusOptions = [
|
||||
{ label: '待报价', value: '0' },
|
||||
{ label: '待完成', value: '1' },
|
||||
{ label: '已完成', value: '2' },
|
||||
{ label: '已取消', value: '3' }
|
||||
{ label: '已取消', value: '3' },
|
||||
{ label: '服务中', value: '4' }
|
||||
]
|
||||
|
||||
const activeFilterCount = computed(() => [
|
||||
@@ -623,6 +643,7 @@ const statusColor = (status: number) => {
|
||||
if (normalized === 1) return 'orange'
|
||||
if (normalized === 2) return 'green'
|
||||
if (normalized === 3) return 'red'
|
||||
if (normalized === 4) return 'processing'
|
||||
return 'default'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user