#
Junjie
2024-08-05 351b16d0a3dc194841c2192cacfabf788ecafd5c
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<script setup>
import { getCurrentInstance, ref, watch, reactive } from 'vue';
import { useRouter } from "vue-router";
import { get, post, postForm } from '@/utils/request.js'
import { message, Modal } from 'ant-design-vue';
import { logout } from '@/config.js';
import { formatMessage } from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
 
const router = useRouter();
 
const TABLE_KEY = 'table-locDetl';
 
let tableData = ref([]);
let open = ref(false);
const orderDetlId = ref(null);
 
const showWidth = ref("60%")
 
const {
    getColumnSearchProps,
} = useTableSearch();
 
const state = reactive({
    selectedRowKeys: [],
    loading: false,
    columns: [],
});
 
state.columns = [
  {
    title: formatMessage('db.man_wait_pakin.order_id', '订单ID'),
    dataIndex: 'orderId$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('orderId$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.order_no', '订单编号'),
    dataIndex: 'orderNo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('orderNo'),
  },
  {
    title: formatMessage('db.man_wait_pakin.barcode', '托盘码'),
    dataIndex: 'barcode',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('barcode'),
  },
  {
    title: formatMessage('db.man_wait_pakin.matnr', '商品编号'),
    dataIndex: ['detl$', 'mat$', 'matnr'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('detl$.matnr'),
  },
  {
    title: formatMessage('db.man_wait_pakin.batch', '批号'),
    dataIndex: ['detl$', 'batch'],
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('detl$.matnr'),
  },
  {
    title: formatMessage('db.man_wait_pakin.anfme', '组托数量'),
    dataIndex: 'anfme',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('anfme'),
  },
  {
    title: formatMessage('db.man_wait_pakin.io_status', '组托状态'),
    dataIndex: 'ioStatus$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('ioStatus$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.status', '状态'),
    dataIndex: 'status$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('status$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.create_time', '添加时间'),
    dataIndex: 'createTime$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('createTime$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.create_by', '添加人员'),
    dataIndex: 'createBy$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('createBy$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.update_time', '修改时间'),
    dataIndex: 'updateTime$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('updateTime$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.update_by', '修改人员'),
    dataIndex: 'updateBy$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('updateBy$'),
  },
  {
    title: formatMessage('db.man_wait_pakin.memo', '备注'),
    dataIndex: 'memo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('memo'),
  },
];
 
const handleOk = () => {
    open.value = false;
}
 
const handleCancel = () => {
    open.value = false;
    orderDetlId.value = null;
}
 
watch(orderDetlId, (newVal, oldVal) => {
    if (newVal != null) {
        get("/api/waitPakin/orderDetlId/" + newVal, {}).then((resp) => {
            let result = resp.data;
            tableData.value = result.data;
        })
    }
})
 
defineExpose({
    tableData,
    orderDetlId,
    open,
    showWidth,
})
 
</script>
 
<script>
export default {
    name: 'waitTaskComponent'
}
</script>
 
<template>
    <div>
        <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel">
            <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
                :scroll="{ y: 768 }" :columns="state.columns">
            </a-table>
        </a-modal>
    </div>
</template>
 
<style></style>