采购功能差不多了

This commit is contained in:
2026-04-14 16:15:21 +08:00
parent 3a38c34ea0
commit 80c4f11b12
5 changed files with 95 additions and 34 deletions
@@ -32,6 +32,7 @@ const order = ref(null);
const costs = ref([]);
const photos = ref([]);
const commits = ref([]);
const canModify = ref(false);
const loading = ref(true);
const notFound = ref(false);
const updatingStatus = ref(false);
@@ -269,6 +270,7 @@ async function fetchOrder() {
const { errCode, data } = await purchaseApi.getOrder(orderId.value);
if (errCode === 0 && data) {
order.value = data.order ?? null;
canModify.value = data.canModify ?? false;
costs.value = data.costs ?? [];
photos.value = data.photos ?? [];
commits.value = data.commits ?? [];
@@ -299,7 +301,7 @@ onMounted(fetchOrder);
</RouterLink>
<!-- 编辑按钮 -->
<RouterLink
v-if="order"
v-if="canModify"
:to="`/purchase/editorder/${order.ID}`"
class="inline-flex items-center gap-1.5 rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-dk-muted dark:bg-dk-card dark:text-gray-300 dark:hover:bg-dk-base"
>
@@ -285,11 +285,20 @@ async function handleSubmit() {
<div
class="flex flex-col gap-6 rounded-xl border border-gray-200 bg-white shadow-lg dark:border-dk-muted dark:bg-dk-card"
>
<!-- ==================== 订单信息区块 ==================== -->
<div class="border-b border-gray-200 px-6 py-4 dark:border-dk-muted">
<!-- ==================== 顶部标题栏 ==================== -->
<div class="flex items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-dk-muted">
<h4 class="text-sm font-semibold text-gray-900 dark:text-white">
{{ t("purchase_addorder.order_info") }}
{{ t("purchase_addorder.add_order") }}
</h4>
<button
class="flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-dk-base"
@click="router.back()"
>
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
</svg>
{{ t("purchase.back") }}
</button>
</div>
<!-- 订单信息表单区域 -->