增加查看哪些产品没有
This commit is contained in:
+61
-5
@@ -33,9 +33,10 @@
|
||||
<el-table-column prop="mappedCode" label="映射后代码" min-width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.mappedCode || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderCount" label="订单数" width="90" align="center" />
|
||||
<el-table-column label="示例订单" min-width="180" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ (row.sampleOrderIds || []).join(', ') || '-' }}</template>
|
||||
<el-table-column prop="orderCount" label="订单数" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" :title="'点击查订单号'" @click="openOrders(row)">{{ row.orderCount ?? 0 }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-if="!(result.missingProducts || []).length" description="未发现缺失产品" />
|
||||
@@ -57,7 +58,11 @@
|
||||
<el-table-column label="命中方式" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ hitText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderCount" label="订单数" width="90" align="center" />
|
||||
<el-table-column prop="orderCount" label="订单数" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" :title="'点击查订单号'" @click="openOrders(row)">{{ row.orderCount ?? 0 }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="packageTabLabel" name="package">
|
||||
@@ -71,17 +76,33 @@
|
||||
</el-tabs>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="orderDialogVisible" :title="orderDialogTitle" width="820px" append-to-body destroy-on-close>
|
||||
<el-table v-loading="orderLoading" :data="orderRows" border size="small" max-height="480">
|
||||
<el-table-column prop="ORDER_ID" label="客户订单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="ORG_ORDER_ID" label="运单号" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="TRANSFER_ORDER_ID" label="转单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="PICKUP_DATE" label="提货时间" width="170" align="center" />
|
||||
</el-table>
|
||||
<el-empty v-if="!orderLoading && !orderRows.length" description="未查到订单" />
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { checkOrderSourceProducts } from '@/api/monitor/orderSource'
|
||||
import { checkOrderSourceProducts, listOrderSourceOrdersByProduct } from '@/api/monitor/orderSource'
|
||||
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const result = ref(null)
|
||||
const activeTab = ref('missing')
|
||||
const lastQuery = ref(null)
|
||||
|
||||
const orderDialogVisible = ref(false)
|
||||
const orderLoading = ref(false)
|
||||
const orderRows = ref([])
|
||||
const orderDialogTitle = ref('产品订单号')
|
||||
|
||||
const missingTabLabel = computed(() => {
|
||||
const n = result.value?.missingCount ?? 0
|
||||
@@ -100,11 +121,46 @@ function hitText(row) {
|
||||
return '无映射'
|
||||
}
|
||||
|
||||
function normalizeRow(row) {
|
||||
if (!row || typeof row !== 'object') return row
|
||||
const out = { ...row }
|
||||
Object.keys(row).forEach(k => {
|
||||
if (!k) return
|
||||
out[k.toUpperCase()] = row[k]
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
function openOrders(row) {
|
||||
if (!row || !row.upstreamCode || !lastQuery.value) {
|
||||
ElMessage.warning('请先选择客户和提货时间')
|
||||
return
|
||||
}
|
||||
const q = {
|
||||
...lastQuery.value,
|
||||
customerCodes: row.customerCode ? [row.customerCode] : lastQuery.value.customerCodes,
|
||||
productCode: row.upstreamCode
|
||||
}
|
||||
orderDialogTitle.value = '产品订单号: ' + row.upstreamCode
|
||||
orderDialogVisible.value = true
|
||||
orderRows.value = []
|
||||
orderLoading.value = true
|
||||
listOrderSourceOrdersByProduct(q).then(res => {
|
||||
const list = Array.isArray(res.data) ? res.data : []
|
||||
orderRows.value = list.map(normalizeRow)
|
||||
}).catch(() => {
|
||||
orderRows.value = []
|
||||
}).finally(() => {
|
||||
orderLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function open(query) {
|
||||
if (!query || !query.customerCodes || !query.beginTime || !query.endTime) {
|
||||
ElMessage.warning('请先选择客户和提货时间')
|
||||
return
|
||||
}
|
||||
lastQuery.value = { ...query }
|
||||
visible.value = true
|
||||
activeTab.value = 'missing'
|
||||
result.value = null
|
||||
|
||||
Reference in New Issue
Block a user