| | |
| | | <ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData"> |
| | | <template #left> |
| | | <ElSpace wrap> |
| | | <ElButton v-auth="'add'" @click="handleShowDialog('add')" v-ripple |
| | | >新增站点区域</ElButton |
| | | > |
| | | <ElButton v-auth="'add'" @click="handleShowDialog('add')" v-ripple> |
| | | {{ t('pages.basicInfo.basStationArea.actions.add') }} |
| | | </ElButton> |
| | | <ElButton |
| | | v-auth="'delete'" |
| | | type="danger" |
| | |
| | | @click="handleBatchDelete" |
| | | v-ripple |
| | | > |
| | | 批量删除 |
| | | {{ t('common.actions.batchDelete') }} |
| | | </ElButton> |
| | | <ListExportPrint |
| | | class="inline-flex" |
| | |
| | | <script setup> |
| | | import { computed, onMounted, ref } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { useI18n } from 'vue-i18n' |
| | | import ListExportPrint from '@/components/biz/list-export-print/index.vue' |
| | | import { useAuth } from '@/hooks/core/useAuth' |
| | | import { useTable } from '@/hooks/core/useTable' |
| | |
| | | |
| | | const { hasAuth } = useAuth() |
| | | const userStore = useUserStore() |
| | | const { t } = useI18n() |
| | | |
| | | const searchForm = ref(createBasStationAreaSearchState()) |
| | | const detailDrawerVisible = ref(false) |
| | |
| | | |
| | | const searchItems = computed(() => [ |
| | | { |
| | | label: '关键字', |
| | | label: t('pages.basicInfo.basStationArea.search.condition'), |
| | | key: 'condition', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入站点区域名称/编号/备注' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.condition') |
| | | } |
| | | }, |
| | | { |
| | | label: '开始时间', |
| | | label: t('pages.basicInfo.basStationArea.search.timeStart'), |
| | | key: 'timeStart', |
| | | type: 'date', |
| | | props: { |
| | | clearable: true, |
| | | type: 'date', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | placeholder: '请选择开始时间' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.timeStart') |
| | | } |
| | | }, |
| | | { |
| | | label: '结束时间', |
| | | label: t('pages.basicInfo.basStationArea.search.timeEnd'), |
| | | key: 'timeEnd', |
| | | type: 'date', |
| | | props: { |
| | | clearable: true, |
| | | type: 'date', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | placeholder: '请选择结束时间' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.timeEnd') |
| | | } |
| | | }, |
| | | { |
| | | label: '站点区域名称', |
| | | label: t('pages.basicInfo.basStationArea.search.stationAreaName'), |
| | | key: 'stationAreaName', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入站点区域名称' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.stationAreaName') |
| | | } |
| | | }, |
| | | { |
| | | label: '站点区域编号', |
| | | label: t('pages.basicInfo.basStationArea.search.stationAreaId'), |
| | | key: 'stationAreaId', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入站点区域编号' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.stationAreaId') |
| | | } |
| | | }, |
| | | { |
| | | label: '站点类型', |
| | | label: t('pages.basicInfo.basStationArea.search.type'), |
| | | key: 'type', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '所属库区', |
| | | label: t('pages.basicInfo.basStationArea.search.area'), |
| | | key: 'area', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '使用状态', |
| | | label: t('pages.basicInfo.basStationArea.search.useStatus'), |
| | | key: 'useStatus', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '可入', |
| | | label: t('pages.basicInfo.basStationArea.search.inAble'), |
| | | key: 'inAble', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '可出', |
| | | label: t('pages.basicInfo.basStationArea.search.outAble'), |
| | | key: 'outAble', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '是否跨区', |
| | | label: t('pages.basicInfo.basStationArea.search.isCrossZone'), |
| | | key: 'isCrossZone', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '跨区区域', |
| | | label: t('pages.basicInfo.basStationArea.search.crossZoneArea'), |
| | | key: 'crossZoneArea', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入跨区区域' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.crossZoneArea') |
| | | } |
| | | }, |
| | | { |
| | | label: '是否WCS', |
| | | label: t('pages.basicInfo.basStationArea.search.isWcs'), |
| | | key: 'isWcs', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: 'WCS数据', |
| | | label: t('pages.basicInfo.basStationArea.search.wcsData'), |
| | | key: 'wcsData', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入WCS数据' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.wcsData') |
| | | } |
| | | }, |
| | | { |
| | | label: '容器类型', |
| | | label: t('pages.basicInfo.basStationArea.search.containerType'), |
| | | key: 'containerType', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入容器类型' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.containerType') |
| | | } |
| | | }, |
| | | { |
| | | label: '自动调拨', |
| | | label: t('pages.basicInfo.basStationArea.search.autoTransfer'), |
| | | key: 'autoTransfer', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '条码', |
| | | label: t('pages.basicInfo.basStationArea.search.barcode'), |
| | | key: 'barcode', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入条码' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.barcode') |
| | | } |
| | | }, |
| | | { |
| | | label: '站点别名', |
| | | label: t('pages.basicInfo.basStationArea.search.stationAlias'), |
| | | key: 'stationAlias', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入站点别名' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.stationAlias') |
| | | } |
| | | }, |
| | | { |
| | | label: '状态', |
| | | label: t('pages.basicInfo.basStationArea.search.status'), |
| | | key: 'status', |
| | | type: 'select', |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '备注', |
| | | label: t('pages.basicInfo.basStationArea.search.memo'), |
| | | key: 'memo', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入备注' |
| | | placeholder: t('pages.basicInfo.basStationArea.placeholder.memo') |
| | | } |
| | | } |
| | | ]) |
| | |
| | | fetchBasStationAreaDetail(row.id), |
| | | {}, |
| | | { |
| | | timeoutMessage: '站点区域详情加载超时,已停止等待' |
| | | timeoutMessage: t('pages.basicInfo.basStationArea.messages.detailTimeout') |
| | | } |
| | | ) |
| | | detailData.value = normalizeBasStationAreaDetailRecord(detail, { |
| | |
| | | } catch (error) { |
| | | detailDrawerVisible.value = false |
| | | detailData.value = {} |
| | | ElMessage.error(error?.message || '获取站点区域详情失败') |
| | | ElMessage.error(error?.message || t('pages.basicInfo.basStationArea.messages.detailLoadFailed')) |
| | | } finally { |
| | | detailLoading.value = false |
| | | } |
| | |
| | | ), |
| | | { records: [] }, |
| | | { |
| | | timeoutMessage: '站点别名选项加载超时,已停止等待' |
| | | timeoutMessage: t('pages.basicInfo.basStationArea.messages.stationAliasTimeout') |
| | | } |
| | | ) |
| | | stationOptions.value = resolveBasStationAreaStationOptions( |
| | |
| | | fetchBasStationAreaDetail(row.id), |
| | | {}, |
| | | { |
| | | timeoutMessage: '站点区域详情加载超时,已停止等待' |
| | | timeoutMessage: t('pages.basicInfo.basStationArea.messages.detailTimeout') |
| | | } |
| | | ) |
| | | await handleShowDialog('edit', detail) |
| | | } catch (error) { |
| | | ElMessage.error(error?.message || '获取站点区域详情失败') |
| | | ElMessage.error(error?.message || t('pages.basicInfo.basStationArea.messages.detailLoadFailed')) |
| | | } |
| | | } |
| | | |
| | |
| | | saveRequest: fetchSaveBasStationArea, |
| | | updateRequest: fetchUpdateBasStationArea, |
| | | deleteRequest: fetchDeleteBasStationArea, |
| | | entityName: '站点区域', |
| | | entityName: t('pages.basicInfo.basStationArea.entity'), |
| | | resolveRecordLabel: (record) => record?.stationAreaName || record?.stationAreaId || record?.id, |
| | | refreshCreate, |
| | | refreshUpdate, |
| | |
| | | |
| | | async function loadAreaOptions() { |
| | | const response = await guardRequestWithMessage(fetchWarehouseAreasList(), [], { |
| | | timeoutMessage: '库区选项加载超时,已停止等待' |
| | | timeoutMessage: t('pages.basicInfo.basStationArea.messages.areaOptionsTimeout') |
| | | }) |
| | | const options = resolveBasStationAreaWarehouseAreaOptions( |
| | | defaultResponseAdapter(response).records |
| | |
| | | status: 1 |
| | | }), |
| | | { records: [] }, |
| | | { timeoutMessage: '容器类型选项加载超时,已停止等待' } |
| | | { timeoutMessage: t('pages.basicInfo.basStationArea.messages.containerTypeTimeout') } |
| | | ) |
| | | containerTypeOptions.value = resolveBasStationAreaContainerTypeOptions( |
| | | defaultResponseAdapter(response).records |
| | |
| | | status: 1 |
| | | }), |
| | | { records: [] }, |
| | | { timeoutMessage: '使用状态选项加载超时,已停止等待' } |
| | | { timeoutMessage: t('pages.basicInfo.basStationArea.messages.useStatusTimeout') } |
| | | ) |
| | | useStatusOptions.value = resolveBasStationAreaUseStatusOptions( |
| | | defaultResponseAdapter(response).records |