zhou zhou
9 分钟以前 7c2bffa1a495cc4a3a263f654c08c231009c5c4e
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
<template>
  <ElDialog
    :model-value="visible"
    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="波次单号">{{ wave.code || '--' }}</ElDescriptionsItem>
        <ElDescriptionsItem label="波次类型">{{ wave.typeLabel || '--' }}</ElDescriptionsItem>
        <ElDescriptionsItem label="波次状态">{{ wave.exceStatusText || '--' }}</ElDescriptionsItem>
        <ElDescriptionsItem label="执行数量">{{ 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)">关闭</ElButton>
        <ElButton type="primary" :loading="submitLoading" :disabled="!canSubmit" @click="$emit('submit')">
          下发任务
        </ElButton>
      </div>
    </template>
  </ElDialog>
</template>
 
<script setup>
  defineOptions({ name: 'WavePublicTaskDialog' })
 
  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>