#
Junjie
2024-07-31 34d3396887ccb6a633c7ace6ddfbb3ca27beb429
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
<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 emit = defineEmits(['tableReload'])
 
const open = ref(false);
const barcode = ref(null);
 
const {
    getColumnSearchProps,
} = useTableSearch();
 
const handleOk = () => {
    open.value = false;
    post('/api/rpc/generatePakIn', {
        taskType: 1,
        barcode: barcode.value,
        originSite: "101"
    }).then(resp => {
        let result = resp.data;
        if (result.code === 200) {
            message.success(formatMessage('page.add.success', '生成成功'));
            emit('tableReload', 'reload')
        } else {
            message.error(result.msg);
        }
    })
}
 
const handleCancel = () => {
    open.value = false;
}
 
const waitPakinQueryList = ref(null);
waitPakinQueryListQuery();
function waitPakinQueryListQuery() {
    postForm('/api/waitPakin/barcode/query', {}).then(resp => {
        let result = resp.data;
        waitPakinQueryList.value = result.data;
    })
}
 
defineExpose({
    open,
})
 
</script>
 
<script>
export default {
    name: 'generateTaskComponent'
}
</script>
 
<template>
    <div>
        <a-modal v-model:open="open" :title="formatMessage('task.generateTask', '生成任务')" @ok="handleOk"
            @cancel="handleCancel">
            <a-select v-model:value="barcode" :placeholder="formatMessage('common.select', '请选择')" style="width: 100%"
                show-search :options="waitPakinQueryList" optionFilterProp="label" optionLabelProp="label">
            </a-select>
        </a-modal>
    </div>
</template>
 
<style></style>