| | |
| | | <el-button type="primary" |
| | | plain |
| | | @click="handleImport">导入</el-button> |
| | | <el-dropdown @command="handleHistoryImportCommand"> |
| | | <el-button type="primary" |
| | | plain> |
| | | 历史迁移<el-icon class="el-icon--right"> |
| | | <ArrowDown /> |
| | | </el-icon> |
| | | </el-button> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item command="notShipped">未发货</el-dropdown-item> |
| | | <el-dropdown-item command="shipped">已发货</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" |
| | | plain |
| | |
| | | proxy.$modal.msgError("导入失败,请重试"); |
| | | }, |
| | | }); |
| | | const HISTORY_IMPORT_URL_MAP = { |
| | | notShipped: "/sales/ledger/salesHistory/notShippingImport", |
| | | shipped: "/sales/ledger/salesHistory/shippingImport", |
| | | }; |
| | | |
| | | const changeDaterange = value => { |
| | | if (value) { |
| | |
| | | otherAmountAddDialogVisible.value = false; |
| | | otherAmountAddId.value = null; |
| | | }; |
| | | // 导入 |
| | | const handleImport = () => { |
| | | importUpload.title = "导入销售台账"; |
| | | const openImportDialog = (title, url) => { |
| | | importUpload.title = title; |
| | | importUpload.url = import.meta.env.VITE_APP_BASE_API + url; |
| | | importUpload.open = true; |
| | | importUpload.isUploading = false; |
| | | if (importUploadRef.value) { |
| | | importUploadRef.value.clearFiles(); |
| | | } |
| | | }; |
| | | // 导入 |
| | | const handleImport = () => { |
| | | openImportDialog("导入销售台账", "/sales/ledger/import"); |
| | | }; |
| | | // 历史迁移 |
| | | const handleHistoryImportCommand = command => { |
| | | const url = HISTORY_IMPORT_URL_MAP[command]; |
| | | if (!url) return; |
| | | const title = command === "shipped" ? "历史迁移-已发货" : "历史迁移-未发货"; |
| | | openImportDialog(title, url); |
| | | }; |
| | | |
| | | // 下载导入模板 |
| | | const downloadTemplate = () => { |