| | |
| | | :value="2" /> |
| | | <el-option label="审批失败" |
| | | :value="3" /> |
| | | <el-option label="已发货" |
| | | <el-option label="审批通过" |
| | | :value="4" /> |
| | | <el-option label="已发货" |
| | | :value="5" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="入库状态:"> |
| | |
| | | <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 |
| | |
| | | style="width: 100%" |
| | | :summary-method="summarizeMainTable" |
| | | @expand-change="expandChange" |
| | | height="calc(100vh - 18.5em)"> |
| | | height="calc(100vh - 22em)"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | width="55" |
| | |
| | | type="success">部分入库</el-tag> |
| | | <el-tag v-else-if="Number(scope.row.stockStatus) === 2" |
| | | type="success">已入库</el-tag> |
| | | <el-tag v-else-if="Number(scope.row.stockStatus) === 3" |
| | | type="warning">审批中</el-tag> |
| | | <el-tag v-else |
| | | type="info">-</el-tag> |
| | | </template> |
| | |
| | | proxy.$modal.msgError("导入失败,请重试"); |
| | | }, |
| | | }); |
| | | |
| | | const HISTORY_IMPORT_URL_MAP = { |
| | | notShipped: "/sales/ledger/salesHistory/notShippingImport", |
| | | shipped: "/sales/ledger/salesHistory/shippingImport", |
| | | }; |
| | | const HISTORY_IMPORT_TEMPLATE_URL_MAP = { |
| | | notShipped: "/sales/ledger/salesHistory/notShippingImportTemplate", |
| | | shipped: "/sales/ledger/salesHistory/shippingImportTemplate", |
| | | }; |
| | | const HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP = { |
| | | notShipped: "销售发货历史数据导入模板-未发货.xlsx", |
| | | shipped: "销售发货历史数据导入模板-已发货.xlsx", |
| | | }; |
| | | const currentImportCommand = ref("default"); |
| | | const changeDaterange = value => { |
| | | if (value) { |
| | | searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | |
| | | 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 = () => { |
| | | currentImportCommand.value = "default"; |
| | | openImportDialog("导入销售台账", "/sales/ledger/import"); |
| | | }; |
| | | // 历史迁移 |
| | | const handleHistoryImportCommand = command => { |
| | | const url = HISTORY_IMPORT_URL_MAP[command]; |
| | | if (!url) return; |
| | | currentImportCommand.value = command; |
| | | const title = command === "shipped" ? "历史迁移-已出库" : "历史迁移-未出库"; |
| | | openImportDialog(title, url); |
| | | }; |
| | | |
| | | // 下载导入模板 |
| | | const downloadTemplate = () => { |
| | | const command = currentImportCommand.value; |
| | | if (command && command !== "default") { |
| | | const templateUrl = HISTORY_IMPORT_TEMPLATE_URL_MAP[command]; |
| | | const fileName = HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP[command]; |
| | | if (templateUrl) { |
| | | proxy.download(templateUrl, {}, fileName || "销售发货历史数据导入模板.xlsx"); |
| | | return; |
| | | } |
| | | } |
| | | proxy.download("/sales/ledger/exportTemplate", {}, "销售台账导入模板.xlsx"); |
| | | }; |
| | | const onClose = () => { |