zhou zhou
2 天以前 0a1d91e42e6c5af96e1108e9ebcc37e99eb3b22c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<template>
  <ElDialog
    :model-value="visible"
    :title="t('pages.orders.wave.publicTask.title')"
    width="88%"
    destroy-on-close
    @update:model-value="handleVisibleChange"
  >
    <div class="flex max-h-[calc(100vh-240px)] flex-col gap-4 overflow-hidden">
      <ElDescriptions :column="4" border>
        <ElDescriptionsItem :label="t('pages.orders.wave.publicTask.code')">{{ wave.code || '--' }}</ElDescriptionsItem>
        <ElDescriptionsItem :label="t('pages.orders.wave.publicTask.type')">{{ wave.typeLabel || '--' }}</ElDescriptionsItem>
        <ElDescriptionsItem :label="t('pages.orders.wave.publicTask.exceStatus')">{{ wave.exceStatusText || '--' }}</ElDescriptionsItem>
        <ElDescriptionsItem :label="t('pages.orders.wave.publicTask.workQty')">{{ wave.workQty ?? '--' }}</ElDescriptionsItem>
      </ElDescriptions>
 
      <ElAlert
        v-if="!canSubmit"
        type="warning"
        :title="warningText"
        :closable="false"
        show-icon
      />
 
      <ElCard shadow="never" class="border border-[var(--art-border-color)] flex-1 min-h-0">
        <ArtTable
          :loading="loading"
          :data="data"
          :columns="columns"
          :pagination="pagination"
          @pagination:size-change="$emit('size-change', $event)"
          @pagination:current-change="$emit('current-change', $event)"
        />
      </ElCard>
    </div>
 
    <template #footer>
      <div class="flex items-center justify-end gap-3">
        <ElButton @click="handleVisibleChange(false)">{{ t('common.close') }}</ElButton>
        <ElButton type="primary" :loading="submitLoading" :disabled="!canSubmit" @click="$emit('submit')">
          {{ t('pages.orders.wave.actions.publicTask') }}
        </ElButton>
      </div>
    </template>
  </ElDialog>
</template>
 
<script setup>
  import { useI18n } from 'vue-i18n'
 
  defineOptions({ name: 'WavePublicTaskDialog' })
  const { t } = useI18n()
 
  defineProps({
    visible: { type: Boolean, default: false },
    loading: { type: Boolean, default: false },
    submitLoading: { type: Boolean, default: false },
    wave: { type: Object, default: () => ({}) },
    data: { type: Array, default: () => [] },
    columns: { type: Array, default: () => [] },
    pagination: { type: Object, default: () => ({ current: 1, size: 20, total: 0 }) },
    canSubmit: { type: Boolean, default: false },
    warningText: { type: String, default: '' }
  })
 
  const emit = defineEmits(['update:visible', 'size-change', 'current-change', 'submit'])
 
  function handleVisibleChange(visible) {
    emit('update:visible', visible)
  }
</script>