Commit 46e23a8d by 杨子

refactor(仓库管理): 优化仓库相关功能界面和逻辑

- 移除仓库、货架、物资分类等界面中不必要的字段和搜索条件
- 调整入库单界面,增加状态显示和调整按钮条件判断
- 重构出库单界面,简化查询条件和表单字段
- 优化物资管理界面,移除冗余字段和调整供应商选择逻辑
- 增加库存选择对话框组件,支持出库时选择库存
- 调整axios请求超时时间为300秒
- 统一界面字段命名和显示方式
parent c6689a87
<template>
<el-dialog :title="title" v-model="dialogVisible" width="1200px" append-to-body>
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="80px">
<el-form-item label="物资编码" prop="materialCode">
<el-input v-model="queryParams.materialCode" placeholder="请输入物资编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物资名称" prop="materialName">
<el-input v-model="queryParams.materialName" placeholder="请输入物资名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="货架" prop="locationId">
<el-input v-model="queryParams.locationName" placeholder="请选择货架" readonly clearable>
<template #append>
<el-button type="primary" @click="openLocationSelect">选择货架</el-button>
</template>
</el-input>
</el-form-item>
<el-form-item label="批次号" prop="batchNo">
<el-input v-model="queryParams.batchNo" placeholder="请输入批次号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="inventoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="物资编码" align="center" prop="materialCode" />
<el-table-column label="物资名称" align="center" prop="materialName" />
<el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="物资ID" align="center" prop="materialId" />
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId" /> -->
<!-- <el-table-column label="库区ID" align="center" prop="areaId" /> -->
<el-table-column label="货架ID" align="center" prop="locationId" />
<el-table-column label="批次号" align="center" prop="batchNo" width="180" />
<el-table-column label="生产日期" align="center" prop="productionDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="失效日期" align="center" prop="expirationDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.expirationDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="库存数量" align="center" prop="quantity" />
<el-table-column label="可用数量" align="center" prop="availableQuantity" />
<el-table-column label="锁定数量" align="center" prop="lockedQuantity" />
<el-table-column label="单位成本" align="center" prop="unitCost" />
<el-table-column label="总成本" align="center" prop="totalCost" />
<!-- <el-table-column label="质量状态" align="center" prop="qualityStatus" /> -->
<el-table-column label="库存状态" align="center" prop="inventoryStatus">
<template #default="scope">
<dict-tag :options="inventory_status" :value="scope.row.inventoryStatus" />
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleConfirm"> </el-button>
<el-button @click="handleCancel"> </el-button>
</div>
</template>
</el-dialog>
<!-- 货架选择对话框组件 -->
<LocationSelectDialog ref="locationSelectDialogRef" v-model:visible="locationDialogVisible" title="选择货架"
@confirm="handleLocationConfirm" />
</template>
<script setup name="InventorySelectDialog">
import { ref, computed, onMounted } from 'vue'
import { listWmsInventory } from '@/api/ware/wmsInventory'
import { parseTime } from '@/utils/ruoyi'
import { ElMessage } from 'element-plus'
import LocationSelectDialog from './LocationSelectDialog.vue'
const { proxy } = getCurrentInstance()
const {sys_yes_no, inventory_status} = proxy.useDict('sys_yes_no', 'inventory_status')
const props = defineProps({
visible: {
type: Boolean,
default: false
},
title: {
type: String,
default: '选择库存'
},
warehouseId: {
type: String,
default: null
}
})
const emit = defineEmits(['update:visible', 'confirm', 'cancel'])
const dialogVisible = computed({
get() {
return props.visible
},
set(value) {
emit('update:visible', value)
}
})
// 查询参数
const queryParams = ref({
pageNum: 1,
pageSize: 10,
materialCode: null,
materialName: null,
warehouseId: props.warehouseId,
locationId: null,
batchNo: null,
specification: null,
unit: null,
})
// 库存列表
const inventoryList = ref([])
// 加载状态
const loading = ref(false)
// 总条数
const total = ref(0)
// 选中的库存
const selectedInventory = ref([])
// 搜索按钮操作
function handleQuery() {
loading.value = true
listWmsInventory(queryParams.value).then(response => {
inventoryList.value = response.rows
total.value = response.total
loading.value = false
})
}
// 重置按钮操作
function handleReset() {
queryParams.value = {
pageNum: 1,
pageSize: 10,
materialCode: null,
materialName: null,
warehouseId: props.warehouseId,
locationId: null,
batchNo: null,
specification: null,
unit: null,
}
handleQuery()
}
// 重置按钮别名
const resetQuery = handleReset
// 处理选择变更
function handleSelectionChange(selection) {
selectedInventory.value = selection
}
// 确认按钮操作
function handleConfirm() {
if (selectedInventory.value.length === 0) {
ElMessage.warning('请至少选择一个库存')
return
}
emit('confirm', selectedInventory.value)
handleCancel()
}
// 取消按钮操作
function handleCancel() {
selectedInventory.value = []
emit('cancel')
dialogVisible.value = false
}
// 货架选择对话框状态
const locationDialogVisible = ref(false)
// 货架选择对话框实例引用
const locationSelectDialogRef = ref(null)
// 打开货架选择对话框
function openLocationSelect() {
locationDialogVisible.value = true
locationSelectDialogRef.value?.handleQuery()
}
// 处理货架选择确认
function handleLocationConfirm(selectedLocations) {
if (selectedLocations.length === 0) {
ElMessage.warning('请至少选择一个货架')
return
}
// 只使用第一个选择的货架
queryParams.value.locationId = selectedLocations[0].locationId
queryParams.value.locationName = selectedLocations[0].locationName
locationDialogVisible.value = false
}
defineExpose({
handleQuery,
handleReset,
})
</script>
...@@ -17,14 +17,6 @@ ...@@ -17,14 +17,6 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="仓库类型" prop="warehouseType">
<el-input
v-model="queryParams.warehouseType"
placeholder="请输入仓库类型"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
......
...@@ -17,7 +17,7 @@ const service = axios.create({ ...@@ -17,7 +17,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: import.meta.env.VITE_APP_BASE_API, baseURL: import.meta.env.VITE_APP_BASE_API,
// 超时 // 超时
timeout: 10000 timeout: 300000
}) })
// request拦截器 // request拦截器
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<el-table :data="adjustInventoryDetailList" border style="width: 100%" height="600px"> <el-table :data="adjustInventoryDetailList" border style="width: 100%" height="600px">
<el-table-column prop="wmsMaterial.materialName" label="物资名称" width="200" fixed="left" /> <el-table-column prop="wmsMaterial.materialName" label="物资名称" width="200" fixed="left" />
<el-table-column prop="batchNo" label="批次号" width="150" /> <el-table-column prop="batchNo" label="批次号" width="150" />
<el-table-column prop="actualQuantity" label="数量" width="120"> <el-table-column prop="actualQuantity" label="实际数量" width="120">
<template #default="scope"> <template #default="scope">
<el-input <el-input
v-if="scope.row.isEditing" v-if="scope.row.isEditing"
......
<template> <template>
<el-dialog <el-dialog title="入库操作" v-model="dialogVisible" width="1200px" append-to-body>
title="入库操作"
v-model="dialogVisible"
width="1200px"
append-to-body
>
<el-form :model="inventoryQueryParams" ref="inventoryQueryRef" :inline="true" label-width="120px"> <el-form :model="inventoryQueryParams" ref="inventoryQueryRef" :inline="true" label-width="120px">
<el-form-item label="批次号" prop="batchNo"> <el-form-item label="批次号" prop="batchNo">
<el-input <el-input v-model="inventoryQueryParams.batchNo" placeholder="请输入或扫描批次号" clearable
v-model="inventoryQueryParams.batchNo" @keyup.enter="handleInventoryQuery" @input="handleBatchNoInput" />
placeholder="请输入或扫描批次号"
clearable
@keyup.enter="handleInventoryQuery"
@input="handleBatchNoInput"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleInventoryQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleInventoryQuery">搜索</el-button>
...@@ -24,7 +14,13 @@ ...@@ -24,7 +14,13 @@
<el-table :data="inventoryDetailList" border style="width: 100%; margin-top: 20px;" height="600px"> <el-table :data="inventoryDetailList" border style="width: 100%; margin-top: 20px;" height="600px">
<el-table-column prop="wmsMaterial.materialName" label="物资名称" width="200" /> <el-table-column prop="wmsMaterial.materialName" label="物资名称" width="200" />
<el-table-column prop="batchNo" label="批次号" width="150" /> <el-table-column prop="batchNo" label="批次号" width="150" />
<el-table-column prop="actualQuantity" label="数量" width="100" /> <el-table-column prop="planQuantity" label="计划数量" width="100" />
<el-table-column prop="actualQuantity" label="实际数量" width="100">
<template #default="scope">
<el-input v-model.number="scope.row.actualQuantity" placeholder="请输入实际数量" size="small"
@change="calculateAmount(scope.row)" type="number" :precision="3" :step="0.001" />
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价" width="100" /> <el-table-column prop="unitPrice" label="单价" width="100" />
<el-table-column label="金额" width="100"> <el-table-column label="金额" width="100">
<template #default="scope"> <template #default="scope">
...@@ -33,22 +29,22 @@ ...@@ -33,22 +29,22 @@
</el-table-column> </el-table-column>
<el-table-column prop="wmsLocation.locationName" label="货架" width="100" /> <el-table-column prop="wmsLocation.locationName" label="货架" width="100" />
<el-table-column prop="storageLocation" label="PTL标签" width="180"> <el-table-column prop="storageLocation" label="PTL标签" width="180">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.storageLocation" placeholder="请选择PTL标签" size="small" readonly /> <el-input v-model="scope.row.storageLocation" placeholder="请选择PTL标签" size="small" readonly />
<el-button slot="append" type="primary" size="small" @click="openPtlTagSelect(scope.$index)">选择</el-button> <el-button slot="append" type="primary" size="small" @click="openPtlTagSelect(scope.$index)">选择</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rfidTagIds" label="RFID标签" width="180"> <el-table-column prop="rfidTagIds" label="RFID标签" width="180">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.rfidTagIds" placeholder="请选择RFID标签" size="small" readonly /> <el-input v-model="scope.row.rfidTagIds" placeholder="请选择RFID标签" size="small" readonly />
<el-button slot="append" type="primary" size="small" @click="openRfidTagSelect(scope.$index)">选择</el-button> <el-button slot="append" type="primary" size="small" @click="openRfidTagSelect(scope.$index)">选择</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="wmsInboundOrderItemId" label="操作" width="100" fixed="right"> <el-table-column prop="wmsInboundOrderItemId" label="操作" width="100" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button type="primary" size="small" @click="handleExportQrcode(scope.row)">打印二维码</el-button> <el-button type="primary" size="small" @click="handleExportQrcode(scope.row)">打印二维码</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<template #footer> <template #footer>
...@@ -67,12 +63,8 @@ ...@@ -67,12 +63,8 @@
@confirm="handlePtlTagConfirm" /> @confirm="handlePtlTagConfirm" />
<!-- 二维码打印对话框组件 --> <!-- 二维码打印对话框组件 -->
<QrcodePrintDialog <QrcodePrintDialog ref="qrcodePrintDialogRef" v-model:visible="qrcodePrintDialogVisible"
ref="qrcodePrintDialogRef" :qrcode-value="currentQrcodeValue" @print="handleQrcodePrint" />
v-model:visible="qrcodePrintDialogVisible"
:qrcode-value="currentQrcodeValue"
@print="handleQrcodePrint"
/>
</el-dialog> </el-dialog>
</template> </template>
...@@ -116,6 +108,8 @@ const inventoryQueryParams = ref({ ...@@ -116,6 +108,8 @@ const inventoryQueryParams = ref({
// 入库明细列表 // 入库明细列表
const inventoryDetailList = ref([]) const inventoryDetailList = ref([])
const inboundOrder = ref(null)
// RFID标签选择对话框状态 // RFID标签选择对话框状态
const rfidTagDialogVisible = ref(false) const rfidTagDialogVisible = ref(false)
const rfidTagSelectDialogRef = ref(null) const rfidTagSelectDialogRef = ref(null)
...@@ -138,23 +132,24 @@ function handleBatchNoInput() { ...@@ -138,23 +132,24 @@ function handleBatchNoInput() {
} }
} }
// 计算金额(数量 * 单价)
function calculateAmount(row) {
if (row && row.actualQuantity !== undefined && row.unitPrice !== undefined) {
// 确保数量和单价都是数字
const quantity = parseFloat(row.actualQuantity) || 0;
const unitPrice = parseFloat(row.unitPrice) || 0;
// 计算金额,保留2位小数
row.amount = parseFloat((quantity * unitPrice).toFixed(2));
}
}
// 入库明细查询 // 入库明细查询
function handleInventoryQuery() { function handleInventoryQuery() {
if (!inventoryQueryParams.value.batchNo) { listWmsInboundOrderItem({ batchNo: inventoryQueryParams.value.batchNo, orderId: inboundOrder.value.orderId, putawayStatus: '0' }).then(response => {
proxy.$message.warning('请输入批次号') if (response.rows.length) {
return inventoryDetailList.value = response.rows;
} } else {
proxy.$message.warning('未查询到相关入库明细或已全部入库')
listWmsInboundOrderItem({ batchNo: inventoryQueryParams.value.batchNo, orderId: props.currentOrder.orderId }).then(response => {
if(response.rows.length){
const currentOrder = response.rows[0];
if(currentOrder.putawayStatus === '1'){
proxy.$message.warning('该批次号已上架,不能重复上架')
}else{
inventoryDetailList.value = [currentOrder];
}
}else{
proxy.$message.warning('未查询到相关入库明细')
} }
}).catch(error => { }).catch(error => {
proxy.$message.error('查询入库明细失败:' + error.message) proxy.$message.error('查询入库明细失败:' + error.message)
...@@ -176,6 +171,11 @@ function confirmInventory() { ...@@ -176,6 +171,11 @@ function confirmInventory() {
return return
} }
// 确认前重新计算所有行的金额,确保数据准确性
inventoryDetailList.value.forEach(item => {
calculateAmount(item);
});
proxy.$messageBox.confirm('确定要执行入库操作吗?', '警告', { proxy.$messageBox.confirm('确定要执行入库操作吗?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -238,4 +238,13 @@ function handleExportQrcode(row) { ...@@ -238,4 +238,13 @@ function handleExportQrcode(row) {
function handleQrcodePrint() { function handleQrcodePrint() {
proxy.$message.success('二维码打印成功') proxy.$message.success('二维码打印成功')
} }
function openDialog(currentInboundOrder) {
inboundOrder.value = currentInboundOrder
handleInventoryQuery()
}
defineExpose({
openDialog
})
</script> </script>
...@@ -34,7 +34,11 @@ ...@@ -34,7 +34,11 @@
<el-table-column label="关联单号" align="center" prop="relatedOrderNo" /> <el-table-column label="关联单号" align="center" prop="relatedOrderNo" />
<el-table-column label="总数量" align="center" prop="totalQuantity" /> <el-table-column label="总数量" align="center" prop="totalQuantity" />
<el-table-column label="总金额" align="center" prop="totalAmount" /> <el-table-column label="总金额" align="center" prop="totalAmount" />
<!-- <el-table-column label="单据状态" align="center" prop="orderStatus" /> --> <el-table-column label="状态" align="center" prop="orderStatus">
<template #default="scope">
<dict-tag :options="in_order_status" :value="scope.row.orderStatus" />
</template>
</el-table-column>
<el-table-column label="入库人" align="center" prop="applicantUserName" /> <el-table-column label="入库人" align="center" prop="applicantUserName" />
<el-table-column label="入库时间" align="center" prop="applyTime" width="180"> <el-table-column label="入库时间" align="center" prop="applyTime" width="180">
<template #default="scope"> <template #default="scope">
...@@ -76,7 +80,7 @@ ...@@ -76,7 +80,7 @@
v-hasPermi="['ware:wmsInboundOrder:print']">打印入库单</el-button> v-hasPermi="['ware:wmsInboundOrder:print']">打印入库单</el-button>
<el-button link type="primary" icon="Check" @click="handleInventory(scope.row)" <el-button link type="primary" icon="Check" @click="handleInventory(scope.row)"
v-hasPermi="['ware:wmsInboundOrder:inventory']">入库</el-button> v-hasPermi="['ware:wmsInboundOrder:inventory']">入库</el-button>
<el-button v-if="scope.row.orderStatus !== '0'" link type="primary" icon="SetUp" @click="handleAdjustInventory(scope.row)" <el-button v-if="showAdjustBtn(scope.row)" link type="primary" icon="SetUp" @click="handleAdjustInventory(scope.row)"
v-hasPermi="['ware:wmsInboundOrder:adjust']">调整入库明细信息</el-button> v-hasPermi="['ware:wmsInboundOrder:adjust']">调整入库明细信息</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -154,7 +158,7 @@ ...@@ -154,7 +158,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="入库时间" prop="applyTime"> <el-form-item label="入库时间" prop="applyTime">
<el-date-picker clearable v-model="form.applyTime" type="date" value-format="YYYY-MM-DD" <el-date-picker clearable v-model="form.applyTime" type="date" value-format="YYYY-MM-DD"
placeholder="请选择申请时间" disabled > placeholder="请选择申请时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -217,7 +221,7 @@ ...@@ -217,7 +221,7 @@
<el-divider>入库单明细</el-divider> <el-divider>入库单明细</el-divider>
<el-row :gutter="20" style="margin-bottom: 10px;"> <el-row :gutter="20" style="margin-bottom: 10px;">
<el-col :span="24" style="text-align: right;"> <el-col :span="24" style="text-align: right;">
<el-button v-if="title !== '修改入库单'" type="primary" size="small" icon="Plus" @click="addDetail">添加明细</el-button> <el-button type="primary" size="small" icon="Plus" @click="addDetail">添加明细</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="form.items" border style="width: 100%"> <el-table :data="form.items" border style="width: 100%">
...@@ -238,19 +242,6 @@ ...@@ -238,19 +242,6 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualQuantity" label="实际数量" width="100">
<template #default="scope">
<el-input
v-model.number="scope.row.actualQuantity"
placeholder="请输入实际数量"
size="small"
@change="calculateAmount(scope.row)"
type="number"
:precision="3"
:step="0.001"
/>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位" width="80"> <el-table-column prop="unit" label="单位" width="80">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.unit" placeholder="请输入单位" size="small" disabled /> <el-input v-model="scope.row.unit" placeholder="请输入单位" size="small" disabled />
...@@ -370,6 +361,7 @@ ...@@ -370,6 +361,7 @@
<!-- 入库对话框 --> <!-- 入库对话框 -->
<InventoryDialog <InventoryDialog
ref="inventoryDialogRef"
v-model:visible="inventoryDialogVisible" v-model:visible="inventoryDialogVisible"
:current-order="currentInventoryOrder" :current-order="currentInventoryOrder"
@inventory-success="getList" @inventory-success="getList"
...@@ -395,11 +387,12 @@ import LocationCascaderSelect from "@/components/LocationCascaderSelect.vue" ...@@ -395,11 +387,12 @@ import LocationCascaderSelect from "@/components/LocationCascaderSelect.vue"
import InventoryDialog from "./components/InventoryDialog.vue" import InventoryDialog from "./components/InventoryDialog.vue"
import AdjustInventoryDialog from "./components/AdjustInventoryDialog.vue" import AdjustInventoryDialog from "./components/AdjustInventoryDialog.vue"
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { dayjs } from "element-plus"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const { inbound_type } = proxy.useDict('inbound_type') const { inbound_type, in_order_status } = proxy.useDict('inbound_type', 'in_order_status')
const wmsInboundOrderList = ref([]) const wmsInboundOrderList = ref([])
const open = ref(false) const open = ref(false)
...@@ -440,6 +433,8 @@ const ptlTagSelectDialogRef = ref(null) ...@@ -440,6 +433,8 @@ const ptlTagSelectDialogRef = ref(null)
const qrcodePrintDialogVisible = ref(false) const qrcodePrintDialogVisible = ref(false)
// 二维码打印对话框实例引用 // 二维码打印对话框实例引用
const qrcodePrintDialogRef = ref(null) const qrcodePrintDialogRef = ref(null)
// 入库对话框实例引用
const inventoryDialogRef = ref(null)
// 入库对话框状态 // 入库对话框状态
const inventoryDialogVisible = ref(false) const inventoryDialogVisible = ref(false)
...@@ -502,10 +497,9 @@ const { queryParams, form, rules } = toRefs(data) ...@@ -502,10 +497,9 @@ const { queryParams, form, rules } = toRefs(data)
function handleInventory(row) { function handleInventory(row) {
currentInventoryOrder.value = row currentInventoryOrder.value = row
inventoryDialogVisible.value = true inventoryDialogVisible.value = true
inventoryDialogRef.value?.openDialog(currentInventoryOrder.value)
} }
// 调整已入库信息相关方法 // 调整已入库信息相关方法
// 打开调整入库信息对话框 // 打开调整入库信息对话框
function handleAdjustInventory(row) { function handleAdjustInventory(row) {
...@@ -1012,5 +1006,10 @@ function handleExportQrcode(row) { ...@@ -1012,5 +1006,10 @@ function handleExportQrcode(row) {
qrcodePrintDialogVisible.value = true qrcodePrintDialogVisible.value = true
} }
function showAdjustBtn(row) {
// 当订单状态不是'0'且入库时间(applyTime)小于等于7天时显示调整按钮
return row.orderStatus !== '0' && dayjs(row.applyTime).isSameOrAfter(dayjs().subtract(7, 'day'))
}
getList() getList()
</script> </script>
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="130px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="130px">
<el-form-item label="物资ID" prop="materialId"> <el-form-item label="物资" prop="materialId">
<el-input <el-input v-model="queryParams.materialName" placeholder="请选择物资" readonly clearable class="!w-[240px]">
v-model="queryParams.materialId" <template #append>
placeholder="请输入物资ID" <el-button type="primary" @click="openQueryMaterialSelect">选择物资</el-button>
clearable </template>
@keyup.enter="handleQuery" </el-input>
/>
</el-form-item> </el-form-item>
<el-form-item label="仓库ID" prop="warehouseId"> <el-form-item label="货架" prop="locationId">
<el-input <el-input v-model="queryParams.locationName" placeholder="请选择货架" readonly clearable class="!w-[240px]">
v-model="queryParams.warehouseId" <template #append>
placeholder="请输入仓库ID" <el-button type="primary" @click="openQueryLocationSelect">选择货架</el-button>
clearable </template>
@keyup.enter="handleQuery" </el-input>
/>
</el-form-item>
<el-form-item label="货架ID" prop="locationId">
<el-input
v-model="queryParams.locationId"
placeholder="请输入货架ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="批次号" prop="batchNo"> <el-form-item label="批次号" prop="batchNo">
<el-input <el-input v-model="queryParams.batchNo" placeholder="请输入批次号" clearable @keyup.enter="handleQuery" />
v-model="queryParams.batchNo"
placeholder="请输入批次号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
v-model="queryParams.productionDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="失效日期" prop="expirationDate">
<el-date-picker clearable
v-model="queryParams.expirationDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择失效日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最后入库时间" prop="lastInboundTime">
<el-date-picker clearable
v-model="queryParams.lastInboundTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择最后入库时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后出库时间" prop="lastOutboundTime">
<el-date-picker clearable
v-model="queryParams.lastOutboundTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择最后出库时间">
</el-date-picker>
</el-form-item>
<el-form-item label="RFID标签" prop="rfidTag">
<el-input
v-model="queryParams.rfidTag"
placeholder="请输入RFID标签"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="是否FIFO管理" prop="isFifo">
<el-radio-group v-model="queryParams.isFifo">
<el-radio v-for="item in sys_yes_no" :label="item.value" :key="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
...@@ -87,62 +25,20 @@ ...@@ -87,62 +25,20 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button type="info" plain icon="View" @click="handleLocationVisualization"
type="primary" v-hasPermi="['ware:wmsInventory:visualization']">货架可视化</el-button>
plain </el-col> -->
icon="Plus"
@click="handleAdd"
v-hasPermi="['ware:wmsInventory:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ware:wmsInventory:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ware:wmsInventory:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['ware:wmsInventory:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="View"
@click="handleLocationVisualization"
v-hasPermi="['ware:wmsInventory:visualization']"
>货架可视化</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="wmsInventoryList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="wmsInventoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="物资ID" align="center" prop="materialId" /> <el-table-column label="物资ID" align="center" prop="materialId" />
<el-table-column label="仓库ID" align="center" prop="warehouseId" /> <!-- <el-table-column label="仓库ID" align="center" prop="warehouseId" /> -->
<!-- <el-table-column label="库区ID" align="center" prop="areaId" /> -->
<el-table-column label="货架ID" align="center" prop="locationId" /> <el-table-column label="货架ID" align="center" prop="locationId" />
<el-table-column label="批次号" align="center" prop="batchNo" /> <el-table-column label="批次号" align="center" prop="batchNo" width="180" />
<el-table-column label="生产日期" align="center" prop="productionDate" width="180"> <el-table-column label="生产日期" align="center" prop="productionDate" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d}') }}</span>
...@@ -158,8 +54,12 @@ ...@@ -158,8 +54,12 @@
<el-table-column label="锁定数量" align="center" prop="lockedQuantity" /> <el-table-column label="锁定数量" align="center" prop="lockedQuantity" />
<el-table-column label="单位成本" align="center" prop="unitCost" /> <el-table-column label="单位成本" align="center" prop="unitCost" />
<el-table-column label="总成本" align="center" prop="totalCost" /> <el-table-column label="总成本" align="center" prop="totalCost" />
<el-table-column label="质量状态" align="center" prop="qualityStatus" /> <!-- <el-table-column label="质量状态" align="center" prop="qualityStatus" /> -->
<el-table-column label="库存状态" align="center" prop="inventoryStatus" /> <el-table-column label="库存状态" align="center" prop="inventoryStatus">
<template #default="scope">
<dict-tag :options="inventory_status" :value="scope.row.inventoryStatus" />
</template>
</el-table-column>
<el-table-column label="最后入库时间" align="center" prop="lastInboundTime" width="180"> <el-table-column label="最后入库时间" align="center" prop="lastInboundTime" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.lastInboundTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.lastInboundTime, '{y}-{m}-{d}') }}</span>
...@@ -171,7 +71,6 @@ ...@@ -171,7 +71,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="RFID标签" align="center" prop="rfidTag" /> <el-table-column label="RFID标签" align="center" prop="rfidTag" />
<el-table-column label="条形码" align="center" prop="barcode" />
<el-table-column label="是否FIFO管理" align="center" prop="isFifo"> <el-table-column label="是否FIFO管理" align="center" prop="isFifo">
<template #default="scope"> <template #default="scope">
<dict-tag :options="sys_yes_no" :value="scope.row.isFifo" /> <dict-tag :options="sys_yes_no" :value="scope.row.isFifo" />
...@@ -187,21 +86,18 @@ ...@@ -187,21 +86,18 @@
<el-table-column label="RFID覆盖率" align="center" prop="rfidCoverageRate" /> <el-table-column label="RFID覆盖率" align="center" prop="rfidCoverageRate" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ware:wmsInventory:edit']">修改</el-button> <!-- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ware:wmsInventory:edit']">修改</el-button> -->
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ware:wmsInventory:remove']">删除</el-button> <!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ware:wmsInventory:remove']">删除</el-button> -->
<el-button link type="primary" icon="Document" @click="handleFlowQuery(scope.row)" v-hasPermi="['ware:wmsInventory:flow']">库存履历</el-button> <el-button link type="primary" icon="Document" @click="handleFlowQuery(scope.row)"
<el-button link type="primary" icon="View" @click="handleLocationVisualization(scope.row)" v-hasPermi="['ware:wmsInventory:visualization']">货架可视化</el-button> v-hasPermi="['ware:wmsInventory:flow']">库存履历</el-button>
<el-button link type="primary" icon="View" @click="handleLocationVisualization(scope.row)"
v-hasPermi="['ware:wmsInventory:visualization']">货架可视化</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
v-show="total>0" @pagination="getList" />
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改库存对话框 --> <!-- 添加或修改库存对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body> <el-dialog :title="title" v-model="open" width="800px" append-to-body>
...@@ -221,7 +117,7 @@ ...@@ -221,7 +117,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第二行:仓库ID --> <!-- 第二行:仓库ID -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
...@@ -237,7 +133,7 @@ ...@@ -237,7 +133,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第三行:货架ID --> <!-- 第三行:货架ID -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
...@@ -253,7 +149,7 @@ ...@@ -253,7 +149,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第四行:批次号、批号 --> <!-- 第四行:批次号、批号 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -267,31 +163,25 @@ ...@@ -267,31 +163,25 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第五行:生产日期、失效日期 --> <!-- 第五行:生产日期、失效日期 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="生产日期" prop="productionDate"> <el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable <el-date-picker clearable v-model="form.productionDate" type="date" value-format="YYYY-MM-DD"
v-model="form.productionDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择生产日期"> placeholder="请选择生产日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="失效日期" prop="expirationDate"> <el-form-item label="失效日期" prop="expirationDate">
<el-date-picker clearable <el-date-picker clearable v-model="form.expirationDate" type="date" value-format="YYYY-MM-DD"
v-model="form.expirationDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择失效日期"> placeholder="请选择失效日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第六行:库存数量、可用数量 --> <!-- 第六行:库存数量、可用数量 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -305,7 +195,7 @@ ...@@ -305,7 +195,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第七行:锁定数量、单位成本 --> <!-- 第七行:锁定数量、单位成本 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -319,7 +209,7 @@ ...@@ -319,7 +209,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第八行:总成本、最后入库时间 --> <!-- 第八行:总成本、最后入库时间 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -329,24 +219,18 @@ ...@@ -329,24 +219,18 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最后入库时间" prop="lastInboundTime"> <el-form-item label="最后入库时间" prop="lastInboundTime">
<el-date-picker clearable <el-date-picker clearable v-model="form.lastInboundTime" type="date" value-format="YYYY-MM-DD"
v-model="form.lastInboundTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择最后入库时间"> placeholder="请选择最后入库时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第九行:最后出库时间、RFID标签 --> <!-- 第九行:最后出库时间、RFID标签 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最后出库时间" prop="lastOutboundTime"> <el-form-item label="最后出库时间" prop="lastOutboundTime">
<el-date-picker clearable <el-date-picker clearable v-model="form.lastOutboundTime" type="date" value-format="YYYY-MM-DD"
v-model="form.lastOutboundTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择最后出库时间"> placeholder="请选择最后出库时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -357,7 +241,7 @@ ...@@ -357,7 +241,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第十行:条形码、是否FIFO管理 --> <!-- 第十行:条形码、是否FIFO管理 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -375,7 +259,7 @@ ...@@ -375,7 +259,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第十一行:备注 --> <!-- 第十一行:备注 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
...@@ -384,7 +268,7 @@ ...@@ -384,7 +268,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第十二行:RFID绑定数量、最后RFID检测时间 --> <!-- 第十二行:RFID绑定数量、最后RFID检测时间 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -394,16 +278,13 @@ ...@@ -394,16 +278,13 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最后RFID检测时间" prop="lastRfidDetectTime"> <el-form-item label="最后RFID检测时间" prop="lastRfidDetectTime">
<el-date-picker clearable <el-date-picker clearable v-model="form.lastRfidDetectTime" type="date" value-format="YYYY-MM-DD"
v-model="form.lastRfidDetectTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择最后RFID检测时间"> placeholder="请选择最后RFID检测时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第十三行:RFID覆盖率 --> <!-- 第十三行:RFID覆盖率 -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -422,136 +303,54 @@ ...@@ -422,136 +303,54 @@
</el-dialog> </el-dialog>
<!-- 物资选择对话框 --> <!-- 物资选择对话框 -->
<MaterialSelectDialog <MaterialSelectDialog ref="materialSelectDialogRef" v-model:visible="materialDialogVisible" title="选择物资"
ref="materialSelectDialogRef" @confirm="handleMaterialConfirm" @cancel="handleMaterialCancel" />
v-model:visible="materialDialogVisible"
title="选择物资"
@confirm="handleMaterialConfirm"
@cancel="handleMaterialCancel"
/>
<!-- 仓库选择对话框 --> <!-- 仓库选择对话框 -->
<WarehouseSelectDialog <WarehouseSelectDialog ref="warehouseSelectDialogRef" v-model:visible="warehouseDialogVisible" title="选择仓库"
ref="warehouseSelectDialogRef" @confirm="handleWarehouseConfirm" @cancel="handleWarehouseCancel" />
v-model:visible="warehouseDialogVisible"
title="选择仓库"
@confirm="handleWarehouseConfirm"
@cancel="handleWarehouseCancel"
/>
<!-- 货架选择对话框 --> <!-- 货架选择对话框 -->
<LocationSelectDialog <LocationSelectDialog ref="locationSelectDialogRef" v-model:visible="locationDialogVisible" title="选择货架"
ref="locationSelectDialogRef" @confirm="handleLocationConfirm" @cancel="handleLocationCancel" />
v-model:visible="locationDialogVisible"
title="选择货架"
@confirm="handleLocationConfirm"
@cancel="handleLocationCancel"
/>
<!-- 库存履历对话框 --> <!-- 库存履历对话框 -->
<InventoryFlowDialog <InventoryFlowDialog ref="inventoryFlowDialogRef" v-model:visible="inventoryFlowDialogVisible"
ref="inventoryFlowDialogRef" v-model:inventory-id="selectedInventoryId" title="库存履历" />
v-model:visible="inventoryFlowDialogVisible"
v-model:inventory-id="selectedInventoryId"
title="库存履历"
/>
<!-- 货架可视化对话框 --> <!-- 货架可视化对话框 -->
<el-dialog <el-dialog title="货架可视化" v-model="locationVisualDialogVisible" fullscreen append-to-body>
title="货架可视化"
v-model="locationVisualDialogVisible"
width="1400px"
append-to-body
>
<div class="location-visual-container"> <div class="location-visual-container">
<!-- 第一列:货架信息 --> <!-- 第一列:货架信息 -->
<div class="visual-column location-info"> <div class="visual-column location-info">
<h3>货架信息</h3> <h3>当前货架信息</h3>
<el-form :model="selectedLocationInfo" label-width="80px" class="three-col-form"> <el-form :model="selectedLocationInfo" label-width="80px" class="three-col-form">
<div class="form-row"> <div class="form-row">
<el-form-item label="货架ID">
<span>{{ selectedLocationInfo.locationId || '-' }}</span>
</el-form-item>
<el-form-item label="货架编码"> <el-form-item label="货架编码">
<span>{{ selectedLocationInfo.locationCode || '-' }}</span> <span>{{ selectedLocationInfo.locationCode || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item label="货架名称"> <el-form-item label="货架名称">
<span>{{ selectedLocationInfo.locationName || '-' }}</span> <span>{{ selectedLocationInfo.locationName || '-' }}</span>
</el-form-item> </el-form-item>
</div> <el-form-item label="库区名称">
<div class="form-row"> <span>{{ selectedLocationInfo.areaId || '-' }}</span>
<el-form-item label="所属库区">
<span>{{ selectedLocationInfo.areaName || '-' }}</span>
</el-form-item>
<el-form-item label="货架状态">
<el-tag :type="selectedLocationInfo.status === '1' ? 'success' : 'info'">
{{ selectedLocationInfo.status === '1' ? '在用' : '停用' }}
</el-tag>
</el-form-item>
<el-form-item label="容纳能力">
<span>{{ selectedLocationInfo.capacity || '-' }}</span>
</el-form-item>
</div>
<div class="form-row">
<el-form-item label="已用容量">
<span>{{ selectedLocationInfo.usedCapacity || '0' }}</span>
</el-form-item>
<el-form-item label="物资数量">
<span>{{ selectedLocationInfo.materialCount || '0' }}</span>
</el-form-item>
<!-- 空列占位 -->
<el-form-item>
<span>-</span>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
</div> </div>
<!-- 第二列:可视化展示 --> <!-- 第二列:可视化展示 -->
<div class="visual-column"> <div class="visual-column">
<h3>可视化展示</h3> <h3>可视化展示</h3>
<div class="visualization-container"> <div class="visualization-container">
<div class="warehouse-layout"> <div class="warehouse-layout">
<!-- 货架行 --> <!-- 遍历所有货架 -->
<div class="shelf-row" v-for="row in 4" :key="row"> <div class="shelf-container">
<div class="shelf-label">货架 {{ row }}</div> <!-- 货架单元格 -->
<!-- 货架列 --> <div class="shelf-cell" v-for="location in locations" :key="location.locationId" :class="{'selected': location.locationId === selectedLocationInfo.locationId}">
<div class="shelf-columns"> <div class="shelf-header">
<div <h4>{{ location.locationName }}</h4>
v-for="col in 5" <div class="shelf-code">{{ location.locationCode }}</div>
:key="`${row}-${col}`"
class="shelf-column"
>
<div
class="location-cell"
:class="{
'selected': (row-1)*5 + col === 10,
'occupied': ((row-1)*5 + col) % 3 === 0,
'empty': ((row-1)*5 + col) % 3 !== 0
}"
>
<div class="cell-header">
<div class="cell-code">A{{ row }}{{ col }}</div>
</div>
<div class="cell-body">
<div class="cell-status" v-if="((row-1)*5 + col) % 3 === 0">
<el-icon class="status-icon"><CircleCheckFilled /></el-icon>
<span>已占用</span>
</div>
<div class="cell-status" v-else>
<el-icon class="status-icon"><CircleCloseFilled /></el-icon>
<span>空闲</span>
</div>
<div class="cell-capacity" v-if="((row-1)*5 + col) % 3 === 0">
容量: 80%
</div>
</div>
<div class="cell-footer">
<div class="cell-material-count" v-if="((row-1)*5 + col) % 3 === 0">
物资: 3
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -559,7 +358,6 @@ ...@@ -559,7 +358,6 @@
</div> </div>
</div> </div>
</div> </div>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="locationVisualDialogVisible = false">关闭</el-button> <el-button @click="locationVisualDialogVisible = false">关闭</el-button>
...@@ -571,7 +369,7 @@ ...@@ -571,7 +369,7 @@
<script setup name="WmsInventory"> <script setup name="WmsInventory">
import { listWmsInventory, getWmsInventory, delWmsInventory, addWmsInventory, updateWmsInventory } from "@/api/ware/wmsInventory" import { listWmsInventory, getWmsInventory, delWmsInventory, addWmsInventory, updateWmsInventory } from "@/api/ware/wmsInventory"
import { getWmsLocation } from "@/api/ware/wmsLocation" import { getWmsLocation, listWmsLocation } from "@/api/ware/wmsLocation"
import MaterialSelectDialog from "@/components/MaterialSelectDialog.vue" import MaterialSelectDialog from "@/components/MaterialSelectDialog.vue"
import WarehouseSelectDialog from "@/components/WarehouseSelectDialog.vue" import WarehouseSelectDialog from "@/components/WarehouseSelectDialog.vue"
import LocationSelectDialog from "@/components/LocationSelectDialog.vue" import LocationSelectDialog from "@/components/LocationSelectDialog.vue"
...@@ -579,7 +377,7 @@ import InventoryFlowDialog from "@/components/InventoryFlowDialog.vue" ...@@ -579,7 +377,7 @@ import InventoryFlowDialog from "@/components/InventoryFlowDialog.vue"
import { View, CircleCheckFilled, CircleCloseFilled } from '@element-plus/icons-vue' import { View, CircleCheckFilled, CircleCloseFilled } from '@element-plus/icons-vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const {sys_yes_no} = proxy.useDict('sys_yes_no') const { sys_yes_no, inventory_status } = proxy.useDict('sys_yes_no', 'inventory_status')
const wmsInventoryList = ref([]) const wmsInventoryList = ref([])
const open = ref(false) const open = ref(false)
...@@ -609,6 +407,11 @@ const selectedLocationInfo = reactive({ ...@@ -609,6 +407,11 @@ const selectedLocationInfo = reactive({
usedCapacity: '0', usedCapacity: '0',
materialCount: '0' materialCount: '0'
}) })
// 存储所有货架的列表
const locations = ref([])
// 存储所有货架的单元格数据,结构:{ locationId: string, cells: Cell[] }
const allLocationCells = ref({})
const materialSelectDialogRef = ref(null) const materialSelectDialogRef = ref(null)
const warehouseSelectDialogRef = ref(null) const warehouseSelectDialogRef = ref(null)
const locationSelectDialogRef = ref(null) const locationSelectDialogRef = ref(null)
...@@ -676,7 +479,7 @@ function cancel() { ...@@ -676,7 +479,7 @@ function cancel() {
reset() reset()
} }
// 打开物资选择对话框 // 打开表单物资选择对话框
function openMaterialSelect() { function openMaterialSelect() {
materialDialogVisible.value = true materialDialogVisible.value = true
if (materialSelectDialogRef.value) { if (materialSelectDialogRef.value) {
...@@ -684,6 +487,14 @@ function openMaterialSelect() { ...@@ -684,6 +487,14 @@ function openMaterialSelect() {
} }
} }
// 打开搜索表单物资选择对话框
function openQueryMaterialSelect() {
materialDialogVisible.value = true
if (materialSelectDialogRef.value) {
materialSelectDialogRef.value.handleQuery()
}
}
// 打开仓库选择对话框 // 打开仓库选择对话框
function openWarehouseSelect() { function openWarehouseSelect() {
warehouseDialogVisible.value = true warehouseDialogVisible.value = true
...@@ -692,7 +503,7 @@ function openWarehouseSelect() { ...@@ -692,7 +503,7 @@ function openWarehouseSelect() {
} }
} }
// 打开货架选择对话框 // 打开表单货架选择对话框
function openLocationSelect() { function openLocationSelect() {
locationDialogVisible.value = true locationDialogVisible.value = true
if (locationSelectDialogRef.value) { if (locationSelectDialogRef.value) {
...@@ -700,10 +511,25 @@ function openLocationSelect() { ...@@ -700,10 +511,25 @@ function openLocationSelect() {
} }
} }
// 打开搜索表单货架选择对话框
function openQueryLocationSelect() {
locationDialogVisible.value = true
if (locationSelectDialogRef.value) {
locationSelectDialogRef.value.handleQuery()
}
}
// 确认选择物资 // 确认选择物资
function handleMaterialConfirm(selection) { function handleMaterialConfirm(selection) {
if (selection && selection.length > 0) { if (selection && selection.length > 0) {
form.value.materialId = selection[0].materialId // 根据对话框的使用场景判断是更新表单还是搜索参数
if (title.value.includes('添加') || title.value.includes('修改')) {
form.value.materialId = selection[0].materialId
form.value.materialName = selection[0].materialName
} else {
queryParams.value.materialId = selection[0].materialId
queryParams.value.materialName = selection[0].materialName
}
} }
materialDialogVisible.value = false materialDialogVisible.value = false
} }
...@@ -717,6 +543,7 @@ function handleMaterialCancel() { ...@@ -717,6 +543,7 @@ function handleMaterialCancel() {
function handleWarehouseConfirm(selection) { function handleWarehouseConfirm(selection) {
if (selection && selection.length > 0) { if (selection && selection.length > 0) {
form.value.warehouseId = selection[0].warehouseId form.value.warehouseId = selection[0].warehouseId
form.value.warehouseName = selection[0].warehouseName
} }
warehouseDialogVisible.value = false warehouseDialogVisible.value = false
} }
...@@ -729,9 +556,16 @@ function handleWarehouseCancel() { ...@@ -729,9 +556,16 @@ function handleWarehouseCancel() {
// 确认选择货架 // 确认选择货架
function handleLocationConfirm(selection) { function handleLocationConfirm(selection) {
if (selection && selection.length > 0) { if (selection && selection.length > 0) {
form.value.locationId = selection[0].locationId // 根据对话框的使用场景判断是更新表单还是搜索参数
form.value.locationCode = selection[0].locationCode if (title.value.includes('添加') || title.value.includes('修改')) {
form.value.locationName = selection[0].locationName form.value.locationId = selection[0].locationId
form.value.locationCode = selection[0].locationCode
form.value.locationName = selection[0].locationName
} else {
queryParams.value.locationId = selection[0].locationId
queryParams.value.locationCode = selection[0].locationCode
queryParams.value.locationName = selection[0].locationName
}
} }
locationDialogVisible.value = false locationDialogVisible.value = false
} }
...@@ -787,6 +621,8 @@ function handleQuery() { ...@@ -787,6 +621,8 @@ function handleQuery() {
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
proxy.resetForm("queryRef") proxy.resetForm("queryRef")
queryParams.value.materialName = null
queryParams.value.locationName = null
handleQuery() handleQuery()
} }
...@@ -839,12 +675,12 @@ function submitForm() { ...@@ -839,12 +675,12 @@ function submitForm() {
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const _inventoryIds = row.inventoryId || ids.value const _inventoryIds = row.inventoryId || ids.value
proxy.$modal.confirm('是否确认删除库存编号为"' + _inventoryIds + '"的数据项?').then(function() { proxy.$modal.confirm('是否确认删除库存编号为"' + _inventoryIds + '"的数据项?').then(function () {
return delWmsInventory(_inventoryIds) return delWmsInventory(_inventoryIds)
}).then(() => { }).then(() => {
getList() getList()
proxy.$modal.msgSuccess("删除成功") proxy.$modal.msgSuccess("删除成功")
}).catch(() => {}) }).catch(() => { })
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
...@@ -865,35 +701,17 @@ function handleFlowQuery(row) { ...@@ -865,35 +701,17 @@ function handleFlowQuery(row) {
/** 货架可视化展示 */ /** 货架可视化展示 */
function handleLocationVisualization(row) { function handleLocationVisualization(row) {
if (row) { getWmsLocation(row.locationId).then(response => {
selectedLocationId.value = row.locationId Object.assign(selectedLocationInfo, response.data)
} else { })
// 如果没有选中记录,默认显示第一个记录的货架 // 获取所有货架列表
if (wmsInventoryList.value.length > 0) { listWmsLocation({ pageNum: 1, pageSize: 1000 }).then(response => {
selectedLocationId.value = wmsInventoryList.value[0].locationId locations.value = response.rows;
} })
}
// 获取货架详情信息
if (selectedLocationId.value) {
getWmsLocation(selectedLocationId.value).then(response => {
const locationData = response.data
Object.assign(selectedLocationInfo, {
locationId: locationData.locationId,
locationCode: locationData.locationCode,
locationName: locationData.locationName,
areaName: locationData.areaName || '',
status: locationData.status,
capacity: locationData.capacity || '',
usedCapacity: locationData.usedCapacity || '0',
materialCount: locationData.materialCount || '0'
})
})
}
locationVisualDialogVisible.value = true locationVisualDialogVisible.value = true
} }
getList() getList()
</script> </script>
...@@ -901,7 +719,7 @@ getList() ...@@ -901,7 +719,7 @@ getList()
.location-visual-container { .location-visual-container {
display: flex; display: flex;
gap: 20px; gap: 20px;
height: 500px; flex-direction: column;
} }
.visual-column { .visual-column {
...@@ -928,11 +746,93 @@ getList() ...@@ -928,11 +746,93 @@ getList()
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
} }
.warehouse-layout { .warehouse-layout .shelf-container {
padding: 20px; padding: 20px;
background-color: #f0f2f5; background-color: #f0f2f5;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
}
.shelf-cell {
background-color: #fff;
border: 1px solid #dcdfe6;
border-radius: 8px;
padding: 16px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
cursor: pointer;
}
.shelf-cell:hover {
transform: translateY(-5px);
box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.15);
border-color: #409eff;
}
.shelf-cell.selected {
border-color: #409eff;
border-width: 2px;
box-shadow: 0 4px 15px 0 rgba(64, 158, 255, 0.3);
background-color: #ecf5ff;
transform: translateY(-2px);
}
.shelf-header {
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid #ebeef5;
}
.shelf-header h4 {
margin: 0 0 4px 0;
font-size: 16px;
font-weight: 500;
color: #303133;
}
.shelf-code {
font-size: 14px;
color: #606266;
font-weight: 500;
}
.shelf-info {
display: flex;
flex-direction: column;
gap: 8px;
}
.shelf-status {
display: inline-block;
padding: 2px 8px;
border-radius: 10px;
font-size: 12px;
font-weight: 500;
width: fit-content;
}
.shelf-status.status-enabled {
background-color: #f0f9eb;
color: #67c23a;
border: 1px solid #c2e7b0;
}
.shelf-status.status-disabled {
background-color: #f5f7fa;
color: #909399;
border: 1px solid #e4e7ed;
}
.shelf-capacity,
.shelf-materials {
font-size: 14px;
color: #606266;
display: flex;
align-items: center;
gap: 4px;
} }
.shelf-row { .shelf-row {
...@@ -985,6 +885,17 @@ getList() ...@@ -985,6 +885,17 @@ getList()
min-height: 120px; min-height: 120px;
} }
.location-cell.loading {
justify-content: center;
color: #909399;
background-color: #f5f7fa;
}
.location-cell.loading .el-icon-loading {
font-size: 24px;
margin-bottom: 8px;
}
.location-cell::before { .location-cell::before {
content: ''; content: '';
position: absolute; position: absolute;
...@@ -1071,7 +982,8 @@ getList() ...@@ -1071,7 +982,8 @@ getList()
color: #67c23a; color: #67c23a;
} }
.cell-capacity, .cell-material-count { .cell-capacity,
.cell-material-count {
font-size: 12px; font-size: 12px;
color: #606266; color: #606266;
text-align: center; text-align: center;
......
...@@ -17,22 +17,6 @@ ...@@ -17,22 +17,6 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="所属库区ID" prop="areaId">
<el-input
v-model="queryParams.areaId"
placeholder="请输入所属库区ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="RFID天线ID" prop="rfidAntennaId">
<el-input
v-model="queryParams.rfidAntennaId"
placeholder="请输入RFID天线ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
...@@ -87,9 +71,9 @@ ...@@ -87,9 +71,9 @@
<el-table-column label="货架名称" align="center" prop="locationName" /> <el-table-column label="货架名称" align="center" prop="locationName" />
<el-table-column label="所属库区" align="center" prop="areaId" /> <el-table-column label="所属库区" align="center" prop="areaId" />
<el-table-column label="货架类型" align="center" prop="locationType" /> <el-table-column label="货架类型" align="center" prop="locationType" />
<el-table-column label="X坐标" align="center" prop="xCoordinate" /> <!-- <el-table-column label="X坐标" align="center" prop="xCoordinate" />
<el-table-column label="Y坐标" align="center" prop="yCoordinate" /> <el-table-column label="Y坐标" align="center" prop="yCoordinate" />
<el-table-column label="Z坐标" align="center" prop="zCoordinate" /> <el-table-column label="Z坐标" align="center" prop="zCoordinate" /> -->
<el-table-column label="最大容量" align="center" prop="maxCapacity" /> <el-table-column label="最大容量" align="center" prop="maxCapacity" />
<el-table-column label="当前容量" align="center" prop="currentCapacity" /> <el-table-column label="当前容量" align="center" prop="currentCapacity" />
<el-table-column label="承重限制" align="center" prop="weightLimit" /> <el-table-column label="承重限制" align="center" prop="weightLimit" />
...@@ -146,7 +130,7 @@ ...@@ -146,7 +130,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="X坐标" prop="xCoordinate"> <!-- <el-form-item label="X坐标" prop="xCoordinate">
<el-input v-model="form.xCoordinate" placeholder="请输入X坐标" /> <el-input v-model="form.xCoordinate" placeholder="请输入X坐标" />
</el-form-item> </el-form-item>
<el-form-item label="Y坐标" prop="yCoordinate"> <el-form-item label="Y坐标" prop="yCoordinate">
...@@ -154,7 +138,7 @@ ...@@ -154,7 +138,7 @@
</el-form-item> </el-form-item>
<el-form-item label="Z坐标" prop="zCoordinate"> <el-form-item label="Z坐标" prop="zCoordinate">
<el-input v-model="form.zCoordinate" placeholder="请输入Z坐标" /> <el-input v-model="form.zCoordinate" placeholder="请输入Z坐标" />
</el-form-item> </el-form-item> -->
<el-form-item label="最大容量" prop="maxCapacity"> <el-form-item label="最大容量" prop="maxCapacity">
<el-input v-model="form.maxCapacity" placeholder="请输入最大容量" /> <el-input v-model="form.maxCapacity" placeholder="请输入最大容量" />
</el-form-item> </el-form-item>
......
...@@ -2,81 +2,35 @@ ...@@ -2,81 +2,35 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="物资编码" prop="materialCode"> <el-form-item label="物资编码" prop="materialCode">
<el-input <el-input v-model="queryParams.materialCode" placeholder="请输入物资编码" clearable @keyup.enter="handleQuery" />
v-model="queryParams.materialCode"
placeholder="请输入物资编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="物资名称" prop="materialName"> <el-form-item label="物资名称" prop="materialName">
<el-input <el-input v-model="queryParams.materialName" placeholder="请输入物资名称" clearable @keyup.enter="handleQuery" />
v-model="queryParams.materialName"
placeholder="请输入物资名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="物资分类" prop="categoryId"> <el-form-item label="物资分类" prop="categoryId">
<el-tree-select <el-tree-select v-model="queryParams.categoryId" :data="wmsMaterialCategoryOptions"
v-model="queryParams.categoryId" :props="{ value: 'categoryId', label: 'categoryName', children: 'children' }" value-key="categoryId"
:data="wmsMaterialCategoryOptions" placeholder="请选择物资分类" check-strictly clearable @keyup.enter="handleQuery" />
:props="{ value: 'categoryId', label: 'categoryName', children: 'children' }"
value-key="categoryId"
placeholder="请选择物资分类"
check-strictly
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="规格型号" prop="specification"> <el-form-item label="规格型号" prop="specification">
<el-input <el-input v-model="queryParams.specification" placeholder="请输入规格型号" clearable @keyup.enter="handleQuery" />
v-model="queryParams.specification"
placeholder="请输入规格型号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="计量单位" prop="unit"> <el-form-item label="计量单位" prop="unit">
<el-input <el-input v-model="queryParams.unit" placeholder="请输入计量单位" clearable @keyup.enter="handleQuery" />
v-model="queryParams.unit"
placeholder="请输入计量单位"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="生产厂家" prop="manufacturer"> <el-form-item label="生产厂家" prop="manufacturer">
<el-input <el-input v-model="queryParams.manufacturer" placeholder="请输入生产厂家" clearable @keyup.enter="handleQuery" />
v-model="queryParams.manufacturer"
placeholder="请输入生产厂家"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
<div class="input-with-select"> <div class="input-with-select">
<el-input <el-input v-model="queryParams.supplierName" placeholder="请选择供应商" readonly clearable
v-model="currentSupplierName" @clear="handleSupplierClear('query')" />
placeholder="请选择供应商" <el-button slot="append" icon="Search" @click="handleSupplierSelect('query')">选择</el-button>
readonly
clearable
@clear="handleSupplierClear('query')"
/>
<el-button
slot="append"
icon="Search"
@click="handleSupplierSelect('query')"
>选择</el-button>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="是否RFID" prop="isRfidManaged"> <el-form-item label="是否RFID" prop="isRfidManaged">
<el-select <el-select v-model="queryParams.isRfidManaged" placeholder="请选择是否RFID" clearable @keyup.enter="handleQuery">
v-model="queryParams.isRfidManaged"
placeholder="请选择是否RFID"
clearable
@keyup.enter="handleQuery"
>
<el-option v-for="item in custom_yes_no" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in custom_yes_no" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -88,42 +42,20 @@ ...@@ -88,42 +42,20 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="Plus" @click="handleAdd"
type="primary" v-hasPermi="['ware:wmsMaterial:add']">新增</el-button>
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['ware:wmsMaterial:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
type="success" v-hasPermi="['ware:wmsMaterial:edit']">修改</el-button>
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ware:wmsMaterial:edit']"
>修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
type="danger" v-hasPermi="['ware:wmsMaterial:remove']">删除</el-button>
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ware:wmsMaterial:remove']"
>删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="Download" @click="handleExport"
type="warning" v-hasPermi="['ware:wmsMaterial:export']">导出</el-button>
plain
icon="Download"
@click="handleExport"
v-hasPermi="['ware:wmsMaterial:export']"
>导出</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -131,11 +63,11 @@ ...@@ -131,11 +63,11 @@
<el-table v-loading="loading" :data="wmsMaterialList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="wmsMaterialList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left" /> <el-table-column type="selection" width="55" align="center" fixed="left" />
<el-table-column label="物资编码" align="center" prop="materialCode" width="150" fixed="left" /> <el-table-column label="物资编码" align="center" prop="materialCode" width="150" fixed="left" />
<el-table-column label="物资名称" align="center" prop="materialName" fixed="left"/> <el-table-column label="物资名称" align="center" prop="materialName" fixed="left" />
<el-table-column label="物资分类" align="center" prop="categoryId" /> <el-table-column label="物资分类" align="center" prop="categoryId" />
<el-table-column label="规格型号" align="center" prop="specification" /> <el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="计量单位" align="center" prop="unit" /> <el-table-column label="计量单位" align="center" prop="unit" />
<el-table-column label="物资类型" align="center" prop="materialType" /> <!-- <el-table-column label="物资类型" align="center" prop="materialType" /> -->
<el-table-column label="生产厂家" align="center" prop="manufacturer" /> <el-table-column label="生产厂家" align="center" prop="manufacturer" />
<el-table-column label="供应商" align="center" prop="supplierId"> <el-table-column label="供应商" align="center" prop="supplierId">
<template #default="scope"> <template #default="scope">
...@@ -152,14 +84,9 @@ ...@@ -152,14 +84,9 @@
<el-table-column label="图片" align="center" prop="imageUrl"> <el-table-column label="图片" align="center" prop="imageUrl">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.imageUrl" class="image-preview-container"> <div v-if="scope.row.imageUrl" class="image-preview-container">
<el-button <el-button :key="index" link type="primary" @click="handleImagePreview(scope.row.imageUrl.split(','))"
:key="index" class="preview-image-btn">
link 预览
type="primary"
@click="handleImagePreview(scope.row.imageUrl.split(','))"
class="preview-image-btn"
>
预览
</el-button> </el-button>
</div> </div>
<span v-else></span> <span v-else></span>
...@@ -168,14 +95,8 @@ ...@@ -168,14 +95,8 @@
<el-table-column label="文档" align="center" prop="documentUrl"> <el-table-column label="文档" align="center" prop="documentUrl">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.documentUrl" class="document-preview-container"> <div v-if="scope.row.documentUrl" class="document-preview-container">
<el-button <el-button v-for="(url, index) in scope.row.documentUrl.split(',')" :key="index" link type="primary"
v-for="(url, index) in scope.row.documentUrl.split(',')" @click="handleDocumentPreview(url)" class="preview-document-btn">
:key="index"
link
type="primary"
@click="handleDocumentPreview(url)"
class="preview-document-btn"
>
预览 预览
</el-button> </el-button>
</div> </div>
...@@ -197,19 +118,16 @@ ...@@ -197,19 +118,16 @@
<el-table-column label="RFID粘贴位置" align="center" prop="rfidPosition" /> --> <el-table-column label="RFID粘贴位置" align="center" prop="rfidPosition" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ware:wmsMaterial:edit']">修改</el-button> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ware:wmsMaterial:remove']">删除</el-button> v-hasPermi="['ware:wmsMaterial:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['ware:wmsMaterial:remove']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
v-show="total>0" @pagination="getList" />
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改物资主数据对话框 --> <!-- 添加或修改物资主数据对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body> <el-dialog :title="title" v-model="open" width="800px" append-to-body>
...@@ -229,14 +147,9 @@ ...@@ -229,14 +147,9 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物资分类" prop="categoryId"> <el-form-item label="物资分类" prop="categoryId">
<el-tree-select <el-tree-select v-model="form.categoryId" :data="wmsMaterialCategoryOptions"
v-model="form.categoryId" :props="{ value: 'categoryId', label: 'categoryName', children: 'children' }" value-key="categoryId"
:data="wmsMaterialCategoryOptions" placeholder="请选择物资分类" check-strictly />
:props="{ value: 'categoryId', label: 'categoryName', children: 'children' }"
value-key="categoryId"
placeholder="请选择物资分类"
check-strictly
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -261,18 +174,12 @@ ...@@ -261,18 +174,12 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
<div class="input-with-select"> <div class="input-with-select">
<el-input <el-input v-model="form.supplierName" placeholder="请选择供应商" readonly clearable
v-model="currentSupplierName" @clear="handleSupplierClear('form')">
placeholder="请选择供应商" <template #append>
readonly <el-button slot="append" icon="Search" @click="handleSupplierSelect('form')">选择</el-button>
clearable </template>
@clear="handleSupplierClear('form')" </el-input>
/>
<el-button
slot="append"
icon="Search"
@click="handleSupplierSelect('form')"
>选择</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -321,26 +228,16 @@ ...@@ -321,26 +228,16 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="物资图片"> <el-form-item label="物资图片">
<ImageUpload <ImageUpload v-model="form.imageUrl" :limit="3" :fileSize="5" :fileType="['jpg', 'png', 'gif']"
v-model="form.imageUrl" :isShowTip="true" />
:limit="3"
:fileSize="5"
:fileType="['jpg', 'png', 'gif']"
:isShowTip="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="技术文档"> <el-form-item label="技术文档">
<FileUpload <FileUpload v-model="form.documentUrl" :limit="5" :fileSize="20"
v-model="form.documentUrl" :fileType="['pdf', 'doc', 'docx', 'xls', 'xlsx', 'txt']" :isShowTip="true" />
:limit="5"
:fileSize="20"
:fileType="['pdf', 'doc', 'docx', 'xls', 'xlsx', 'txt']"
:isShowTip="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -370,7 +267,7 @@ ...@@ -370,7 +267,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> --> </el-row> -->
<!-- 自定义属性扩展 --> <!-- 自定义属性扩展 -->
<!-- <el-divider>自定义属性</el-divider> <!-- <el-divider>自定义属性</el-divider>
<el-form-item> <el-form-item>
...@@ -392,14 +289,9 @@ ...@@ -392,14 +289,9 @@
</el-table> </el-table>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<!-- 自定义属性编辑对话框 --> <!-- 自定义属性编辑对话框 -->
<el-dialog <el-dialog v-model="data.showCustomAttrDialog" title="自定义属性编辑" width="400px" append-to-body>
v-model="data.showCustomAttrDialog"
title="自定义属性编辑"
width="400px"
append-to-body
>
<el-form :model="data.customAttrForm" label-width="80px"> <el-form :model="data.customAttrForm" label-width="80px">
<el-form-item label="属性名称" required> <el-form-item label="属性名称" required>
<el-input v-model="data.customAttrForm.attrName" placeholder="请输入属性名称" /> <el-input v-model="data.customAttrForm.attrName" placeholder="请输入属性名称" />
...@@ -423,7 +315,7 @@ ...@@ -423,7 +315,7 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -433,47 +325,21 @@ ...@@ -433,47 +325,21 @@
</el-dialog> </el-dialog>
<!-- 文档预览对话框 --> <!-- 文档预览对话框 -->
<el-dialog <el-dialog v-model="previewDialogVisible" title="文档预览" width="80%" height="80%" :close-on-click-modal="false">
v-model="previewDialogVisible"
title="文档预览"
width="80%"
height="80%"
:close-on-click-modal="false"
>
<div class="document-preview"> <div class="document-preview">
<vue-office-docx <vue-office-docx v-if="currentDocumentType === 'docx'" :src="currentDocumentUrl" style="height: 100%;" />
v-if="currentDocumentType === 'docx'" <vue-office-xlsx v-else-if="currentDocumentType === 'xlsx'" :src="currentDocumentUrl" style="height: 100%;" />
:src="currentDocumentUrl" <vue-office-pdf v-else-if="currentDocumentType === 'pdf'" :src="currentDocumentUrl" style="height: 100%;" />
style="height: 100%;"
/>
<vue-office-xlsx
v-else-if="currentDocumentType === 'xlsx'"
:src="currentDocumentUrl"
style="height: 100%;"
/>
<vue-office-pdf
v-else-if="currentDocumentType === 'pdf'"
:src="currentDocumentUrl"
style="height: 100%;"
/>
</div> </div>
</el-dialog> </el-dialog>
<!-- 图片预览组件 --> <!-- 图片预览组件 -->
<el-image-viewer <el-image-viewer v-if="imageViewerVisible" :url-list="imageList" :initial-index="imageIndex"
v-if="imageViewerVisible" @close="imageViewerVisible = false" />
:url-list="imageList"
:initial-index="imageIndex"
@close="imageViewerVisible = false"
/>
<!-- 供应商选择对话框 --> <!-- 供应商选择对话框 -->
<SupplierSelectDialog <SupplierSelectDialog ref="supplierSelectDialogRef" v-model:visible="supplierDialogVisible"
ref="supplierSelectDialogRef" @confirm="handleSupplierConfirm" @cancel="handleSupplierCancel" />
v-model:visible="supplierDialogVisible"
@confirm="handleSupplierConfirm"
@cancel="handleSupplierCancel"
/>
</div> </div>
</template> </template>
...@@ -493,7 +359,7 @@ import { ElImageViewer } from 'element-plus' ...@@ -493,7 +359,7 @@ import { ElImageViewer } from 'element-plus'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const { sys_normal_disable, custom_yes_no } = proxy.useDict('sys_normal_disable','custom_yes_no') const { sys_normal_disable, custom_yes_no } = proxy.useDict('sys_normal_disable', 'custom_yes_no')
const wmsMaterialList = ref([]) const wmsMaterialList = ref([])
const open = ref(false) const open = ref(false)
...@@ -649,14 +515,16 @@ function handleSupplierConfirm(selected) { ...@@ -649,14 +515,16 @@ function handleSupplierConfirm(selected) {
selectedSupplier.value = supplier selectedSupplier.value = supplier
currentSupplierId.value = supplier.supplierId currentSupplierId.value = supplier.supplierId
currentSupplierName.value = supplier.supplierName currentSupplierName.value = supplier.supplierName
// 根据调用类型设置不同的目标 // 根据调用类型设置不同的目标
if (isQuery.value) { if (isQuery.value) {
// 来自查询表单 // 来自查询表单
queryParams.value.supplierId = supplier.supplierId queryParams.value.supplierId = supplier.supplierId
queryParams.value.supplierName = supplier.supplierName
} else { } else {
// 来自编辑表单 // 来自编辑表单
form.value.supplierId = supplier.supplierId form.value.supplierId = supplier.supplierId
form.value.supplierName = supplier.supplierName
} }
} }
supplierDialogVisible.value = false supplierDialogVisible.value = false
...@@ -672,7 +540,7 @@ function handleSupplierClear(type) { ...@@ -672,7 +540,7 @@ function handleSupplierClear(type) {
currentSupplierName.value = '' currentSupplierName.value = ''
currentSupplierId.value = null currentSupplierId.value = null
selectedSupplier.value = null selectedSupplier.value = null
if (type === 'query') { if (type === 'query') {
queryParams.value.supplierId = null queryParams.value.supplierId = null
} else { } else {
...@@ -720,8 +588,8 @@ function reset() { ...@@ -720,8 +588,8 @@ function reset() {
}) })
delete data.customAttrForm._editingIndex delete data.customAttrForm._editingIndex
data.showCustomAttrDialog = false data.showCustomAttrDialog = false
proxy.resetForm("wmsMaterialRef") proxy.resetForm("wmsMaterialRef")
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -782,7 +650,7 @@ function saveCustomAttr() { ...@@ -782,7 +650,7 @@ function saveCustomAttr() {
proxy.$modal.msgError("属性名称和属性值不能为空") proxy.$modal.msgError("属性名称和属性值不能为空")
return return
} }
const editingIndex = data.customAttrForm._editingIndex const editingIndex = data.customAttrForm._editingIndex
if (editingIndex !== undefined) { if (editingIndex !== undefined) {
// 编辑现有属性 // 编辑现有属性
...@@ -792,7 +660,7 @@ function saveCustomAttr() { ...@@ -792,7 +660,7 @@ function saveCustomAttr() {
// 添加新属性 // 添加新属性
form.value.customAttributes.push({ ...data.customAttrForm }) form.value.customAttributes.push({ ...data.customAttrForm })
} }
// 重置表单 // 重置表单
Object.assign(data.customAttrForm, { Object.assign(data.customAttrForm, {
attrName: '', attrName: '',
...@@ -840,12 +708,12 @@ function submitForm() { ...@@ -840,12 +708,12 @@ function submitForm() {
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const _materialIds = row.materialId || ids.value const _materialIds = row.materialId || ids.value
proxy.$modal.confirm('是否确认删除物资主数据编号为"' + _materialIds + '"的数据项?').then(function() { proxy.$modal.confirm('是否确认删除物资主数据编号为"' + _materialIds + '"的数据项?').then(function () {
return delWmsMaterial(_materialIds) return delWmsMaterial(_materialIds)
}).then(() => { }).then(() => {
getList() getList()
proxy.$modal.msgSuccess("删除成功") proxy.$modal.msgSuccess("删除成功")
}).catch(() => {}) }).catch(() => { })
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> <dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="属性模板" align="center" prop="attributeTemplate" /> <!-- <el-table-column label="属性模板" align="center" prop="attributeTemplate" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ware:wmsMaterialCategory:edit']">修改</el-button> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ware:wmsMaterialCategory:edit']">修改</el-button>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<el-form-item label="分类名称" prop="categoryName"> <el-form-item label="分类名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入分类名称" /> <el-input v-model="form.categoryName" placeholder="请输入分类名称" />
</el-form-item> </el-form-item>
<el-form-item label="父分类ID" prop="parentId"> <el-form-item label="上级分类" prop="parentId">
<el-tree-select <el-tree-select
v-model="form.parentId" v-model="form.parentId"
:data="wmsMaterialCategoryOptions" :data="wmsMaterialCategoryOptions"
...@@ -97,9 +97,9 @@ ...@@ -97,9 +97,9 @@
<el-form-item label="排序" prop="sortOrder"> <el-form-item label="排序" prop="sortOrder">
<el-input v-model="form.sortOrder" placeholder="请输入显示顺序" /> <el-input v-model="form.sortOrder" placeholder="请输入显示顺序" />
</el-form-item> </el-form-item>
<el-form-item label="属性模板" prop="attributeTemplate"> <!-- <el-form-item label="属性模板" prop="attributeTemplate">
<el-input v-model="form.attributeTemplate" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.attributeTemplate" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
......
...@@ -9,22 +9,6 @@ ...@@ -9,22 +9,6 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="仓库ID" prop="warehouseId">
<el-input
v-model="queryParams.warehouseId"
placeholder="请输入仓库ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="客户ID" prop="customerId">
<el-input
v-model="queryParams.customerId"
placeholder="请输入客户ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="关联单号" prop="relatedOrderNo"> <el-form-item label="关联单号" prop="relatedOrderNo">
<el-input <el-input
v-model="queryParams.relatedOrderNo" v-model="queryParams.relatedOrderNo"
...@@ -33,94 +17,6 @@ ...@@ -33,94 +17,6 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="申请人" prop="applicantId">
<el-input
v-model="queryParams.applicantId"
placeholder="请输入申请人"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="申请时间" prop="applyTime">
<el-date-picker clearable
v-model="queryParams.applyTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="预计发货日期" prop="expectedDeliveryDate">
<el-date-picker clearable
v-model="queryParams.expectedDeliveryDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择预计发货日期">
</el-date-picker>
</el-form-item>
<el-form-item label="实际发货日期" prop="actualDeliveryDate">
<el-date-picker clearable
v-model="queryParams.actualDeliveryDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择实际发货日期">
</el-date-picker>
</el-form-item>
<el-form-item label="拣货员" prop="pickingPersonId">
<el-input
v-model="queryParams.pickingPersonId"
placeholder="请输入拣货员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="拣货时间" prop="pickingTime">
<el-date-picker clearable
v-model="queryParams.pickingTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择拣货时间">
</el-date-picker>
</el-form-item>
<el-form-item label="复核员" prop="checkerId">
<el-input
v-model="queryParams.checkerId"
placeholder="请输入复核员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="复核时间" prop="checkTime">
<el-date-picker clearable
v-model="queryParams.checkTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择复核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="发货员" prop="deliveryPersonId">
<el-input
v-model="queryParams.deliveryPersonId"
placeholder="请输入发货员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="发货时间" prop="deliveryTime">
<el-date-picker clearable
v-model="queryParams.deliveryTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择发货时间">
</el-date-picker>
</el-form-item>
<el-form-item label="出库策略" prop="outboundStrategy">
<el-input
v-model="queryParams.outboundStrategy"
placeholder="请输入出库策略"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
...@@ -137,35 +33,6 @@ ...@@ -137,35 +33,6 @@
v-hasPermi="['ware:wmsOutboundOrder:add']" v-hasPermi="['ware:wmsOutboundOrder:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ware:wmsOutboundOrder:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ware:wmsOutboundOrder:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['ware:wmsOutboundOrder:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -182,9 +49,13 @@ ...@@ -182,9 +49,13 @@
<el-table-column label="关联单号" align="center" prop="relatedOrderNo" /> <el-table-column label="关联单号" align="center" prop="relatedOrderNo" />
<el-table-column label="总数量" align="center" prop="totalQuantity" /> <el-table-column label="总数量" align="center" prop="totalQuantity" />
<el-table-column label="总金额" align="center" prop="totalAmount" /> <el-table-column label="总金额" align="center" prop="totalAmount" />
<el-table-column label="单据状态" align="center" prop="orderStatus" /> <el-table-column label="状态" align="center" prop="orderStatus">
<el-table-column label="申请人" align="center" prop="applicantId" /> <template #default="scope">
<el-table-column label="申请时间" align="center" prop="applyTime" width="180"> <dict-tag :options="out_order_status" :value="scope.row.orderStatus" />
</template>
</el-table-column>
<el-table-column label="出库人" align="center" prop="applicantId" />
<el-table-column label="出库时间" align="center" prop="applyTime" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
</template> </template>
...@@ -199,26 +70,7 @@ ...@@ -199,26 +70,7 @@
<span>{{ parseTime(scope.row.actualDeliveryDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.actualDeliveryDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="拣货员" align="center" prop="pickingPersonId" /> <!-- <el-table-column label="出库策略" align="center" prop="outboundStrategy" /> -->
<el-table-column label="拣货时间" align="center" prop="pickingTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.pickingTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="复核员" align="center" prop="checkerId" />
<el-table-column label="复核时间" align="center" prop="checkTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="发货员" align="center" prop="deliveryPersonId" />
<el-table-column label="发货时间" align="center" prop="deliveryTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审批状态" align="center" prop="approvalStatus" />
<el-table-column label="出库策略" align="center" prop="outboundStrategy" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
<template #default="scope"> <template #default="scope">
...@@ -237,16 +89,23 @@ ...@@ -237,16 +89,23 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改出库单对话框 --> <!-- 添加或修改出库单对话框 -->
<el-dialog :title="title" v-model="open" width="1500px" append-to-body> <el-dialog :title="title" v-model="open" width="1500px" append-to-body>
<el-form ref="wmsOutboundOrderRef" :model="form" :rules="rules" label-width="120px"> <el-form ref="wmsOutboundOrderRef" :model="form" :rules="rules" label-width="120px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="出库单号" prop="orderNo"> <el-form-item label="出库单号" prop="orderNo">
<el-input v-model="form.orderNo" placeholder="请输入出库单号" /> <el-input v-model="form.orderNo" placeholder="请输入出库单号" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="出库类型" prop="orderType">
<el-radio-group v-model="form.orderType">
<el-radio v-for="item in outbound_type" :label="item.value">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库" prop="warehouseId"> <el-form-item label="仓库" prop="warehouseId">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="18"> <el-col :span="18">
...@@ -260,7 +119,7 @@ ...@@ -260,7 +119,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="客户" prop="customerId"> <el-form-item label="客户" prop="customerId">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="18"> <el-col :span="18">
...@@ -272,32 +131,31 @@ ...@@ -272,32 +131,31 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="关联单号" prop="relatedOrderNo"> <el-form-item label="关联单号" prop="relatedOrderNo">
<el-input v-model="form.relatedOrderNo" placeholder="请输入关联单号" /> <el-input v-model="form.relatedOrderNo" placeholder="请输入关联单号" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="总数量" prop="totalQuantity"> <el-form-item label="总数量" prop="totalQuantity">
<el-input v-model="form.totalQuantity" placeholder="请输入总数量" /> <el-input v-model="form.totalQuantity" placeholder="请输入总数量" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="总金额" prop="totalAmount"> <el-form-item label="总金额" prop="totalAmount">
<el-input v-model="form.totalAmount" placeholder="请输入总金额" /> <el-input v-model="form.totalAmount" placeholder="请输入总金额" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
<el-row :gutter="20"> <el-form-item label="出库人" prop="applicantId">
<el-col :span="12">
<el-form-item label="申请人" prop="applicantId">
<el-input v-model="form.applicantId" placeholder="请输入申请人" /> <el-input v-model="form.applicantId" placeholder="请输入申请人" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="申请时间" prop="applyTime"> <el-form-item label="出库时间" prop="applyTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.applyTime" v-model="form.applyTime"
type="date" type="date"
...@@ -308,7 +166,7 @@ ...@@ -308,7 +166,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="预计发货日期" prop="expectedDeliveryDate"> <el-form-item label="预计发货日期" prop="expectedDeliveryDate">
<el-date-picker clearable <el-date-picker clearable
v-model="form.expectedDeliveryDate" v-model="form.expectedDeliveryDate"
...@@ -318,7 +176,7 @@ ...@@ -318,7 +176,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="实际发货日期" prop="actualDeliveryDate"> <el-form-item label="实际发货日期" prop="actualDeliveryDate">
<el-date-picker clearable <el-date-picker clearable
v-model="form.actualDeliveryDate" v-model="form.actualDeliveryDate"
...@@ -329,7 +187,7 @@ ...@@ -329,7 +187,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <!-- <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="拣货员" prop="pickingPersonId"> <el-form-item label="拣货员" prop="pickingPersonId">
<el-input v-model="form.pickingPersonId" placeholder="请输入拣货员" /> <el-input v-model="form.pickingPersonId" placeholder="请输入拣货员" />
...@@ -379,14 +237,14 @@ ...@@ -379,14 +237,14 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row> -->
<el-row :gutter="20"> <!-- <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="出库策略" prop="outboundStrategy"> <el-form-item label="出库策略" prop="outboundStrategy">
<el-input v-model="form.outboundStrategy" placeholder="请输入出库策略" /> <el-input v-model="form.outboundStrategy" placeholder="请输入出库策略" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row> -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -480,12 +338,13 @@ ...@@ -480,12 +338,13 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 物资选择对话框组件 --> <!-- 库存选择对话框组件 -->
<MaterialSelectDialog <InventorySelectDialog
ref="materialSelectDialogRef" ref="inventorySelectDialogRef"
v-model:visible="materialDialogVisible" v-model:visible="inventoryDialogVisible"
title="选择物资" title="选择库存"
@confirm="handleMaterialConfirm" :warehouse-id="data.form.warehouseId"
@confirm="handleInventoryConfirm"
/> />
<!-- 仓库选择对话框组件 --> <!-- 仓库选择对话框组件 -->
...@@ -508,14 +367,14 @@ ...@@ -508,14 +367,14 @@
<script setup name="WmsOutboundOrder"> <script setup name="WmsOutboundOrder">
import { listWmsOutboundOrder, getWmsOutboundOrder, delWmsOutboundOrder, addWmsOutboundOrder, updateWmsOutboundOrder } from "@/api/ware/wmsOutboundOrder" import { listWmsOutboundOrder, getWmsOutboundOrder, delWmsOutboundOrder, addWmsOutboundOrder, updateWmsOutboundOrder } from "@/api/ware/wmsOutboundOrder"
import MaterialSelectDialog from "@/components/MaterialSelectDialog.vue"
import WarehouseSelectDialog from "@/components/WarehouseSelectDialog.vue" import WarehouseSelectDialog from "@/components/WarehouseSelectDialog.vue"
import CustomerSelectDialog from "@/components/CustomerSelectDialog.vue" import CustomerSelectDialog from "@/components/CustomerSelectDialog.vue"
import { listWmsMaterial } from "@/api/ware/wmsMaterial" import InventorySelectDialog from "@/components/InventorySelectDialog.vue"
import { generateOutboundOrderNo } from "@/api/ware/codeGenerator"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const {outbound_type} = proxy.useDict('outbound_type') const {outbound_type, out_order_status} = proxy.useDict('outbound_type', 'out_order_status')
const wmsOutboundOrderList = ref([]) const wmsOutboundOrderList = ref([])
const open = ref(false) const open = ref(false)
...@@ -527,10 +386,10 @@ const multiple = ref(true) ...@@ -527,10 +386,10 @@ const multiple = ref(true)
const total = ref(0) const total = ref(0)
const title = ref("") const title = ref("")
// 物资选择对话框状态 // 库存选择对话框状态
const materialDialogVisible = ref(false) const inventoryDialogVisible = ref(false)
// 物资选择对话框实例引用 // 库存选择对话框实例引用
const materialSelectDialogRef = ref(null) const inventorySelectDialogRef = ref(null)
// 仓库选择对话框状态 // 仓库选择对话框状态
const warehouseDialogVisible = ref(false) const warehouseDialogVisible = ref(false)
...@@ -583,7 +442,7 @@ const data = reactive({ ...@@ -583,7 +442,7 @@ const data = reactive({
const { queryParams, form, rules } = toRefs(data) const { queryParams, form, rules } = toRefs(data)
/** 查询出库单列表 */ /** 查询出库单列表 */
function getList() { function getList() {
loading.value = true loading.value = true
listWmsOutboundOrder(queryParams.value).then(response => { listWmsOutboundOrder(queryParams.value).then(response => {
...@@ -655,8 +514,12 @@ function handleSelectionChange(selection) { ...@@ -655,8 +514,12 @@ function handleSelectionChange(selection) {
/** 新增按钮操作 */ /** 新增按钮操作 */
function handleAdd() { function handleAdd() {
reset() reset()
// 调用API生成出库单号
generateOutboundOrderNo().then(response => {
form.value.orderNo = response.msg
})
open.value = true open.value = true
title.value = "添加出库单" title.value = "添加出库单"
} }
/** 打开仓库选择对话框 */ /** 打开仓库选择对话框 */
...@@ -700,7 +563,7 @@ function handleUpdate(row) { ...@@ -700,7 +563,7 @@ function handleUpdate(row) {
getWmsOutboundOrder(_orderId).then(response => { getWmsOutboundOrder(_orderId).then(response => {
form.value = response.data form.value = response.data
open.value = true open.value = true
title.value = "修改出库单" title.value = "修改出库单"
}) })
} }
...@@ -756,33 +619,43 @@ function addDetail() { ...@@ -756,33 +619,43 @@ function addDetail() {
if (!form.value.details) { if (!form.value.details) {
form.value.details = [] form.value.details = []
} }
// 打开物资选择对话框 // // 检查是否已选择仓库
materialDialogVisible.value = true // if (!data.form.warehouseId) {
// 调用组件方法加载物资分类和列表 // proxy.$modal.msgWarning("请先选择仓库")
materialSelectDialogRef.value.getTreeselect() // return
materialSelectDialogRef.value.handleQuery() // }
// 打开库存选择对话框
inventoryDialogVisible.value = true
// 调用组件方法加载库存列表
if (inventorySelectDialogRef.value) {
inventorySelectDialogRef.value.handleQuery()
}
} }
/** 处理物资选择确认 */ /** 处理库存选择确认 */
function handleMaterialConfirm(selectedMaterials) { function handleInventoryConfirm(selectedInventories) {
if (selectedMaterials.length === 0) { if (selectedInventories.length === 0) {
proxy.$modal.msgWarning("请至少选择一个物资") proxy.$modal.msgWarning("请至少选择一个库存")
return return
} }
// 将选中的物资添加到明细列表 // 将选中的库存添加到明细列表
selectedMaterials.forEach(material => { selectedInventories.forEach(inventory => {
form.value.details.push({ form.value.details.push({
materialId: material.materialId, materialId: inventory.materialId,
materialName: material.materialName, materialCode: inventory.materialCode,
materialName: inventory.materialName,
specification: inventory.specification,
planQuantity: null, planQuantity: null,
actualQuantity: null, actualQuantity: null,
unit: material.unit, unit: inventory.unit,
unitPrice: null, unitPrice: inventory.unitPrice,
amount: null, amount: null,
batchNo: null, batchNo: inventory.batchNo,
productionDate: null, productionDate: inventory.productionDate,
expirationDate: null, expirationDate: inventory.expirationDate,
warehouseId: inventory.warehouseId,
locationName: inventory.locationName,
remark: null remark: null
}) })
}) })
...@@ -796,7 +669,7 @@ function deleteDetail(index) { ...@@ -796,7 +669,7 @@ function deleteDetail(index) {
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const _orderIds = row.orderId || ids.value const _orderIds = row.orderId || ids.value
proxy.$modal.confirm('是否确认删除出库单主编号为"' + _orderIds + '"的数据项?').then(function() { proxy.$modal.confirm('是否确认删除?').then(function() {
return delWmsOutboundOrder(_orderIds) return delWmsOutboundOrder(_orderIds)
}).then(() => { }).then(() => {
getList() getList()
......
...@@ -17,38 +17,6 @@ ...@@ -17,38 +17,6 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="仓库面积" prop="area">
<el-input
v-model="queryParams.area"
placeholder="请输入仓库面积"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库容量" prop="capacity">
<el-input
v-model="queryParams.capacity"
placeholder="请输入仓库容量"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="仓货架置" prop="location">
<el-input
v-model="queryParams.location"
placeholder="请输入仓货架置"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库管理员" prop="managerId">
<el-input
v-model="queryParams.managerId"
placeholder="请输入仓库管理员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
...@@ -105,8 +73,8 @@ ...@@ -105,8 +73,8 @@
<el-table-column label="仓库类型" align="center" prop="warehouseType" /> <el-table-column label="仓库类型" align="center" prop="warehouseType" />
<el-table-column label="仓库面积" align="center" prop="area" /> <el-table-column label="仓库面积" align="center" prop="area" />
<el-table-column label="仓库容量" align="center" prop="capacity" /> <el-table-column label="仓库容量" align="center" prop="capacity" />
<el-table-column label="仓货置" align="center" prop="location" /> <el-table-column label="仓货置" align="center" prop="location" />
<el-table-column label="仓库管理员" align="center" prop="managerId" /> <!-- <el-table-column label="仓库管理员" align="center" prop="managerId" /> -->
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> <dict-tag :options="sys_normal_disable" :value="scope.row.status" />
...@@ -144,12 +112,12 @@ ...@@ -144,12 +112,12 @@
<el-form-item label="仓库容量" prop="capacity"> <el-form-item label="仓库容量" prop="capacity">
<el-input v-model="form.capacity" placeholder="请输入仓库容量" /> <el-input v-model="form.capacity" placeholder="请输入仓库容量" />
</el-form-item> </el-form-item>
<el-form-item label="仓货置" prop="location"> <el-form-item label="仓货置" prop="location">
<el-input v-model="form.location" placeholder="请输入仓货置" /> <el-input v-model="form.location" placeholder="请输入仓货置" />
</el-form-item> </el-form-item>
<el-form-item label="仓库管理员" prop="managerId"> <!-- <el-form-item label="仓库管理员" prop="managerId">
<el-input v-model="form.managerId" placeholder="请输入仓库管理员" /> <el-input v-model="form.managerId" placeholder="请输入仓库管理员" />
</el-form-item> </el-form-item> -->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment