up
This commit is contained in:
@@ -86,7 +86,7 @@
|
|||||||
"items": "orders.",
|
"items": "orders.",
|
||||||
"order_detail": "Order Detail",
|
"order_detail": "Order Detail",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"back_to_list": "Back to List",
|
"back_to_list": "Go Back",
|
||||||
"order_not_found": "Order Not Found",
|
"order_not_found": "Order Not Found",
|
||||||
"delete_order": "Delete Order",
|
"delete_order": "Delete Order",
|
||||||
"confirm_delete": "Are you sure you want to delete this order? This action cannot be undone.",
|
"confirm_delete": "Are you sure you want to delete this order? This action cannot be undone.",
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
"submit_commit": "Submit",
|
"submit_commit": "Submit",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"back_to_list": "Back to List",
|
"back_to_list": "Go Back",
|
||||||
"not_found": "Work order not found",
|
"not_found": "Work order not found",
|
||||||
"confirm_delete": "Are you sure you want to delete this work order? This action cannot be undone.",
|
"confirm_delete": "Are you sure you want to delete this work order? This action cannot be undone.",
|
||||||
"confirm_delete_commit": "Are you sure you want to delete this progress?",
|
"confirm_delete_commit": "Are you sure you want to delete this progress?",
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
"items": "个订单",
|
"items": "个订单",
|
||||||
"order_detail": "订单详情",
|
"order_detail": "订单详情",
|
||||||
"back": "返回",
|
"back": "返回",
|
||||||
"back_to_list": "返回列表",
|
"back_to_list": "返回",
|
||||||
"order_not_found": "订单不存在",
|
"order_not_found": "订单不存在",
|
||||||
"delete_order": "删除订单",
|
"delete_order": "删除订单",
|
||||||
"confirm_delete": "确定要删除此订单吗?此操作不可撤销。",
|
"confirm_delete": "确定要删除此订单吗?此操作不可撤销。",
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
"submit_commit": "提交",
|
"submit_commit": "提交",
|
||||||
"edit": "编辑",
|
"edit": "编辑",
|
||||||
"delete": "删除",
|
"delete": "删除",
|
||||||
"back_to_list": "返回列表",
|
"back_to_list": "返回",
|
||||||
"not_found": "工单不存在",
|
"not_found": "工单不存在",
|
||||||
"confirm_delete": "确定要删除此工单吗?此操作不可撤销。",
|
"confirm_delete": "确定要删除此工单吗?此操作不可撤销。",
|
||||||
"confirm_delete_commit": "确定要删除此进度吗?",
|
"confirm_delete_commit": "确定要删除此进度吗?",
|
||||||
|
|||||||
@@ -341,13 +341,13 @@ onMounted(fetchOrder);
|
|||||||
<div class="mx-auto max-w-6xl px-6 py-6">
|
<div class="mx-auto max-w-6xl px-6 py-6">
|
||||||
<!-- 顶部操作栏:返回 + 编辑 -->
|
<!-- 顶部操作栏:返回 + 编辑 -->
|
||||||
<div class="mb-4 flex items-center justify-between">
|
<div class="mb-4 flex items-center justify-between">
|
||||||
<RouterLink
|
<button
|
||||||
to="/purchase"
|
@click="$router.back()"
|
||||||
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-dk-card dark:hover:text-gray-200"
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-dk-card dark:hover:text-gray-200"
|
||||||
>
|
>
|
||||||
<IconChevronLeft :size="16" />
|
<IconChevronLeft :size="16" />
|
||||||
{{ t("purchase.back_to_list") }}
|
{{ t("purchase.back_to_list") }}
|
||||||
</RouterLink>
|
</button>
|
||||||
<!-- 编辑按钮 -->
|
<!-- 编辑按钮 -->
|
||||||
<RouterLink
|
<RouterLink
|
||||||
v-if="canModify"
|
v-if="canModify"
|
||||||
|
|||||||
@@ -61,6 +61,21 @@ const canSubmit = computed(() => {
|
|||||||
return hasSelectedOrders || hasComment || hasPhotos
|
return hasSelectedOrders || hasComment || hasPhotos
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 所有 commits 中关联的采购订单(去重)
|
||||||
|
const allPurchaseOrders = computed(() => {
|
||||||
|
const map = new Map()
|
||||||
|
for (const commit of commits.value) {
|
||||||
|
if (commit.purchaseOrders) {
|
||||||
|
for (const po of commit.purchaseOrders) {
|
||||||
|
if (!map.has(po.id)) {
|
||||||
|
map.set(po.id, po)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [...map.values()]
|
||||||
|
})
|
||||||
|
|
||||||
// 点击外部关闭下拉框
|
// 点击外部关闭下拉框
|
||||||
function onDocumentClick(e) {
|
function onDocumentClick(e) {
|
||||||
if (purchaseDropdownRef.value && !purchaseDropdownRef.value.contains(e.target)) {
|
if (purchaseDropdownRef.value && !purchaseDropdownRef.value.contains(e.target)) {
|
||||||
@@ -309,13 +324,13 @@ onUnmounted(() => {
|
|||||||
<div class="mx-auto max-w-6xl px-6 py-6">
|
<div class="mx-auto max-w-6xl px-6 py-6">
|
||||||
<!-- 顶部操作栏 -->
|
<!-- 顶部操作栏 -->
|
||||||
<div class="mb-4 flex items-center justify-between">
|
<div class="mb-4 flex items-center justify-between">
|
||||||
<RouterLink
|
<button
|
||||||
to="/work_order"
|
@click="$router.back()"
|
||||||
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-dk-card dark:hover:text-gray-200"
|
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-dk-card dark:hover:text-gray-200"
|
||||||
>
|
>
|
||||||
<IconChevronLeft :size="16" />
|
<IconChevronLeft :size="16" />
|
||||||
{{ t('work_order.back_to_list') }}
|
{{ t('work_order.back_to_list') }}
|
||||||
</RouterLink>
|
</button>
|
||||||
<RouterLink
|
<RouterLink
|
||||||
v-if="canModify && order"
|
v-if="canModify && order"
|
||||||
:to="`/work_order/edit/${order.ID}`"
|
:to="`/work_order/edit/${order.ID}`"
|
||||||
@@ -411,6 +426,26 @@ onUnmounted(() => {
|
|||||||
<label class="mb-1 block text-xs font-medium text-gray-400">{{ t('work_order.description') }}</label>
|
<label class="mb-1 block text-xs font-medium text-gray-400">{{ t('work_order.description') }}</label>
|
||||||
<p class="whitespace-pre-wrap text-sm text-gray-700 dark:text-gray-300">{{ order.Description }}</p>
|
<p class="whitespace-pre-wrap text-sm text-gray-700 dark:text-gray-300">{{ order.Description }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 关联采购订单汇总(去重) -->
|
||||||
|
<div v-if="allPurchaseOrders.length > 0">
|
||||||
|
<label class="mb-1 block text-xs font-medium text-gray-400">关联采购订单</label>
|
||||||
|
<div class="flex flex-wrap gap-2">
|
||||||
|
<RouterLink
|
||||||
|
v-for="po in allPurchaseOrders"
|
||||||
|
:key="po.id"
|
||||||
|
:to="`/purchase/showorder/${po.id}`"
|
||||||
|
class="inline-flex items-center gap-1 rounded-full border border-blue-200 bg-blue-50 px-2.5 py-1 text-xs font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-900/30 dark:text-blue-300 dark:hover:bg-blue-900/50"
|
||||||
|
>
|
||||||
|
#{{ po.id }} {{ po.title || '' }}
|
||||||
|
<span
|
||||||
|
class="ml-1 rounded px-1.5 py-0.5 text-[10px]"
|
||||||
|
:class="getPurchaseStatusClass(po.status)"
|
||||||
|
>
|
||||||
|
{{ getPurchaseStatusLabel(po.status) }}
|
||||||
|
</span>
|
||||||
|
</RouterLink>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 图片区 -->
|
<!-- 图片区 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user