Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2025-12-05 17:04:12 +08:00
6 changed files with 66 additions and 34 deletions

View File

@@ -932,7 +932,7 @@ body {
// 对话框主体
.el-dialog__body {
padding: $--spacing-lg;
max-height: 60vh;
max-height: 80vh;
overflow-y: auto;
}

View File

@@ -1,12 +1,14 @@
<template>
<el-tree v-loading="loading" :data="treeData" :props="treeProps" node-key="warehouseId" highlight-current
@node-click="handleNodeClick" :expand-on-click-node="false"
:lazy="this.warehouseType === 'real'" :load="loadChildren" class="stock-tree" />
<div>
<el-tree key="warehouseTree" v-loading="loading" :data="treeData" :props="treeProps" node-key="actualWarehouseId" highlight-current
@node-click="handleNodeClick" :expand-on-click-node="false" class="stock-tree" />
</div>
</template>
<script>
import { listWarehouse } from '@/api/wms/warehouse';
import { listActualWarehouse } from '@/api/wms/actualWarehouse';
// import { listActualWarehouse } from '@/api/wms/actualWarehouse';
import { treeActualWarehouseTwoLevel } from '@/api/wms/actualWarehouse';
export default {
name: "WarehouseTree",
@@ -22,8 +24,8 @@ export default {
loading: true,
treeProps: {
children: 'children',
label: 'warehouseLabel',
isLeaf: () => false
label: 'actualWarehouseName',
isLeaf: 'isLeaf'
}
};
},
@@ -37,33 +39,30 @@ export default {
},
methods: {
loadChildren(node, resolve) {
console.log(node);
if (this.warehouseType !== 'real') {
return;
}
if (node.level === 0) {
// resolve(this.handleTree(this.treeData, 'warehouseId', 'parentId'));
} else {
listActualWarehouse({ parentId: node.data.actualWarehouseId }).then(response => {
resolve(response.data.map(item => ({
...item,
warehouseLabel: item.actualWarehouseName
})));
resolve(response.data);
});
}
},
getWarehouseTree() {
this.loading = true;
if (this.warehouseType === 'real') {
listActualWarehouse({ parentId: 0 }).then(response => {
this.treeData = response.data.map(item => ({
...item,
warehouseLabel: item.actualWarehouseName
}))
treeActualWarehouseTwoLevel().then(response => {
this.treeData = response.data
this.loading = false;
});
} else {
listWarehouse().then(response => {
this.treeData = response.data.map(item => ({
...item,
warehouseLabel: item.warehouseName
actualWarehouseId: item.warehouseId,
actualWarehouseName: item.warehouseName
}))
this.loading = false;
});

View File

@@ -28,7 +28,7 @@
<!-- 钻取表格 -->
<el-table
max-height="400"
height="400"
v-loading="loading"
:data="list"
border
@@ -39,7 +39,7 @@
<el-table-column prop="warehouseName" label="库位" align="center" min-width="150"></el-table-column>
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" v-if="!hideWarehouseQuery"/>
<el-table-column prop="currentCoilNo" label="当前卷号" align="center" min-width="120"></el-table-column>
<el-table-column prop="enterCoilNo" label="入场卷号" align="center" min-width="180"></el-table-column>
<el-table-column prop="enterCoilNo" label="入场卷号" align="center"></el-table-column>
<el-table-column label="物料类型" align="center" prop="itemType">
<template slot-scope="scope">
{{ scope.row.itemType == 'product' ? '成品' : '原料' }}
@@ -51,9 +51,17 @@
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" />
<el-table-column prop="grossWeight" label="毛重(kg)" align="center" min-width="100"></el-table-column>
<el-table-column prop="netWeight" label="净重(kg)" align="center" min-width="100"></el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime">
<template slot-scope="scope">
{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column prop="grossWeight" label="重量(t)" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.netWeight }} / {{ scope.row.grossWeight }}
</template>
</el-table-column>
<!-- <el-table-column prop="netWeight" label="净重(kg)" align="center" min-width="100"></el-table-column> -->
</el-table>
</el-skeleton>

View File

@@ -85,7 +85,7 @@
<el-table-column label="逻辑库位" align="center" prop="warehouseName" v-if="!hideWarehouseQuery" />
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" v-if="!hideWarehouseQuery" />
<!-- <el-table-column label="物料类型" align="center" prop="materialType" /> -->
<el-table-column label="产品类型" align="center" width="220">
<el-table-column label="产品类型" align="center" width="250">
<template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />

View File

@@ -36,7 +36,7 @@
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
</template>
</el-table-column>
<el-table-column label="产品类型" align="center" prop="itemName" width="220">
<el-table-column label="产品类型" align="center" prop="itemName" width="250">
<template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product' || scope.row.itemType == 'semi'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
@@ -231,7 +231,33 @@ export default {
});
} else {
listStock(this.queryParams).then(response => {
this.stockList = response.rows;
this.stockList = response.rows.map(item => {
const itemType = item.itemType
if (itemType === 'raw_material') {
item.rawMaterial = {
rawMaterialId: item.itemId,
rawMaterialName: item.itemName,
rawMaterialCode: item.itemCode,
specification: item.specification,
material: item.material,
surfaceTreatment: item.surfaceTreatment,
zincLayer: item.zincLayer,
manufacturer: item.manufacturer,
}
} else if (itemType === 'product') {
item.product = {
productId: item.itemId,
productName: item.itemName,
productCode: item.itemCode,
specification: item.specification,
material: item.material,
surfaceTreatment: item.surfaceTreatment,
zincLayer: item.zincLayer,
manufacturer: item.manufacturer,
}
}
return item
});
this.total = response.total;
this.loading = false;
});

View File

@@ -34,9 +34,9 @@
<el-button type="primary" icon="el-icon-plus" size="mini" @click="openQuickDialog()">
快速新增 1~3
</el-button>
<!-- <el-button type="success" icon="el-icon-plus" size="mini" @click="openCreateDialog()">
新增级节点
</el-button> -->
<el-button type="success" icon="el-icon-plus" size="mini" @click="openCreateDialog()">
新增级节点
</el-button>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleDownloadTemplate">
下载导入模板
</el-button>
@@ -237,7 +237,7 @@
>
<el-form ref="editForm" :model="editDialog.form" :rules="editDialog.rules" label-width="90px">
<el-form-item label="层级" prop="actualWarehouseType">
<el-radio-group v-model="editDialog.form.actualWarehouseType" size="small">
<el-radio-group disabled v-model="editDialog.form.actualWarehouseType" size="small">
<el-radio-button :label="1">一级</el-radio-button>
<el-radio-button :label="2">二级</el-radio-button>
<el-radio-button :label="3">三级</el-radio-button>
@@ -279,7 +279,8 @@
custom-class="warehouse-dialog"
>
<el-form ref="createForm" :model="createDialog.form" :rules="createDialog.rules" label-width="90px">
<el-form-item label="父节点">
<!-- 仅当不是顶级节点时显示父节点和层级 -->
<el-form-item v-if="createDialog.form.parentId !== 0 || createDialog.parentNode" label="父节点">
<template v-if="createDialog.parentPath">
<span>{{ createDialog.parentPath }}</span>
</template>
@@ -292,7 +293,7 @@
/>
</template>
</el-form-item>
<el-form-item label="层级" prop="actualWarehouseType">
<el-form-item v-if="createDialog.form.parentId !== 0 || createDialog.parentNode" label="层级" prop="actualWarehouseType">
<el-radio-group v-model="createDialog.form.actualWarehouseType" size="small" :disabled="!!createDialog.parentNode">
<el-radio-button :label="1">一级</el-radio-button>
<el-radio-button :label="2">二级</el-radio-button>
@@ -382,7 +383,6 @@ export default {
remark: ""
},
rules: {
actualWarehouseType: [{ required: true, message: "请选择层级", trigger: "change" }],
actualWarehouseCode: [{ required: true, message: "请输入编码", trigger: "blur" }],
actualWarehouseName: [{ required: true, message: "请输入名称", trigger: "blur" }],
sortNo: [{ required: true, type: "number", message: "请输入排序号", trigger: "change" }]
@@ -404,7 +404,6 @@ export default {
remark: ""
},
rules: {
actualWarehouseType: [{ required: true, message: "请选择层级", trigger: "change" }],
actualWarehouseCode: [{ required: true, message: "请输入编码", trigger: "blur" }],
actualWarehouseName: [{ required: true, message: "请输入名称", trigger: "blur" }],
sortNo: [{ required: true, type: "number", message: "请输入排序号", trigger: "change" }]