|
|
|
|
@ -117,6 +117,13 @@
|
|
|
|
|
>
|
|
|
|
|
{{ t('action.edit') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="info"
|
|
|
|
|
@click="openDetail(scope.row.id)"
|
|
|
|
|
>
|
|
|
|
|
{{ t('action.detail') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
@ -139,6 +146,77 @@
|
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
|
|
<WarehouseForm ref="formRef" @success="getList" />
|
|
|
|
|
|
|
|
|
|
<!-- 详情弹窗 -->
|
|
|
|
|
<Dialog :title="t('action.detail')" v-model="detailDialogVisible" width="1200px">
|
|
|
|
|
<div v-if="detailData">
|
|
|
|
|
<el-descriptions :column="2" border>
|
|
|
|
|
<el-descriptions-item :label="t('ErpStock.Warehouse.name')">{{ detailData.name }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item :label="t('ErpStock.Warehouse.address')">{{ detailData.address }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item :label="t('ErpStock.Warehouse.principal')">{{ detailData.principal }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item :label="t('ErpStock.Warehouse.remark')">{{ detailData.remark || '-' }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item :label="t('ErpStock.Warehouse.sort')">{{ detailData.sort }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item :label="t('ErpStock.Warehouse.status')">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="detailData.status" />
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
<el-tabs v-model="activeTab" class="mt-4">
|
|
|
|
|
<el-tab-pane :label="t('ErpStock.WarehouseArea.areaName')" name="area">
|
|
|
|
|
<el-table :data="detailData.areaList || []" style="width: 100%">
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.areaCode')" prop="areaCode" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.areaName')" prop="areaName" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.areaSize')" prop="areaSize" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.description')" prop="description" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.status')" prop="status">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.createTime')" prop="createTime" :formatter="(row) => new Date(row.createTime).toLocaleString()" />
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane :label="t('ErpStock.WarehouseLocation.name')" name="location">
|
|
|
|
|
<el-table :data="detailData.locationList || []" style="width: 100%">
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseArea.areaName')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ getAreaName(scope.row.areaId) }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.code')" prop="code" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.name')" prop="name" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.areaSize')" prop="areaSize" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.maxLoadWeight')" prop="maxLoadWeight" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.position')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ scope.row.positionX }}, {{ scope.row.positionY }}, {{ scope.row.positionZ }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.allowProductMix')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag :type="scope.row.allowProductMix ? 'success' : 'danger'" size="small">
|
|
|
|
|
{{ scope.row.allowProductMix ? t('common.yes') : t('common.no') }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.allowBatchMix')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag :type="scope.row.allowBatchMix ? 'success' : 'danger'" size="small">
|
|
|
|
|
{{ scope.row.allowBatchMix ? t('common.yes') : t('common.no') }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.status')" prop="status">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.WarehouseLocation.createTime')" prop="createTime" :formatter="(row) => new Date(row.createTime).toLocaleString()" />
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
@ -148,6 +226,7 @@ import download from '@/utils/download'
|
|
|
|
|
import { WarehouseApi, WarehouseVO } from '@/api/erp/stock/warehouse'
|
|
|
|
|
import WarehouseForm from './WarehouseForm.vue'
|
|
|
|
|
import { erpPriceTableColumnFormatter } from '@/utils'
|
|
|
|
|
import { Dialog } from '@/components/Dialog'
|
|
|
|
|
|
|
|
|
|
/** ERP 仓库列表 */
|
|
|
|
|
defineOptions({ name: 'ErpWarehouse' })
|
|
|
|
|
@ -166,6 +245,9 @@ const queryParams = reactive({
|
|
|
|
|
})
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
const detailDialogVisible = ref(false) // 详情弹窗的是否展示
|
|
|
|
|
const detailData = ref<WarehouseVO | null>(null) // 详情的数据
|
|
|
|
|
const activeTab = ref('area') // 当前激活的tab
|
|
|
|
|
|
|
|
|
|
/** 查询列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
@ -247,6 +329,22 @@ const handleExport = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 打开详情弹窗 */
|
|
|
|
|
const openDetail = async (id: number) => {
|
|
|
|
|
try {
|
|
|
|
|
detailData.value = await WarehouseApi.getWarehouse(id)
|
|
|
|
|
detailDialogVisible.value = true
|
|
|
|
|
} catch (error) {
|
|
|
|
|
message.error(t('common.requestError'))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 根据库区ID获取库区名称 */
|
|
|
|
|
const getAreaName = (areaId: number) => {
|
|
|
|
|
if (!detailData.value?.areaList) return '-'
|
|
|
|
|
return detailData.value.areaList.find((area) => area.id === areaId)?.areaName || '-'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 选中操作 */
|
|
|
|
|
const selectionList = ref<WarehouseVO[]>([])
|
|
|
|
|
const handleSelectionChange = (rows: WarehouseVO[]) => {
|
|
|
|
|
|