| | |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postBlob } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import { globalState, logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import ShowOrderDetlComponent from '@/components/orderDetl/show.vue'; |
| | | import { |
| | | DownOutlined, |
| | | UploadOutlined, |
| | | DownloadOutlined, |
| | | } from "@ant-design/icons-vue"; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | const fileList = ref([]); |
| | | const handleUploadChange = info => { |
| | | if (info.file.status !== 'uploading') { |
| | | // console.log(info.file, info.fileList); |
| | | } |
| | | if (info.file.status === 'done') { |
| | | let result = info.file.response; |
| | | if(result.code == 200) { |
| | | message.success(`${info.file.name} ${formatMessage('page.upload.success', '上传成功')}`); |
| | | }else { |
| | | message.error(result.msg); |
| | | } |
| | | } else if (info.file.status === 'error') { |
| | | message.error(`${info.file.name} file upload failed.`); |
| | | } |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | |
| | | <template #overlay> |
| | | <a-menu @click="handleSyncOrderClick"> |
| | | <a-menu-item key="import"> |
| | | <UserOutlined /> |
| | | <a-upload v-model:file-list="fileList" name="file" action="/api/order/upload" |
| | | @change="handleUploadChange" :showUploadList="false" :headers="{ |
| | | Authorization: globalState.token |
| | | }"> |
| | | <UploadOutlined /> |
| | | {{ formatMessage('page.order.import', '单据导入') }} |
| | | </a-upload> |
| | | </a-menu-item> |
| | | |
| | | <a-menu-item key="export"> |
| | | <UserOutlined /> |
| | | <DownloadOutlined /> |
| | | {{ formatMessage('page.order.export.template', '导出模板') }} |
| | | </a-menu-item> |
| | | </a-menu> |