refactor(wms): 重构物料信息展示逻辑,移除冗余组件
重构物料信息展示逻辑,统一使用itemName等字段替代原有的product和rawMaterial嵌套结构 删除不再使用的BomInfo、CategoryRenderer等冗余组件 新增report模块配置集中管理 优化代码结构,提升可维护性
This commit is contained in:
@@ -367,3 +367,15 @@ export function exportCoilWithAll(data) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询带有发货绑定信息的钢卷
|
||||
*/
|
||||
export function listWithBindInfoCoil(params) {
|
||||
return request({
|
||||
url: '/wms/materialCoil/listWithBindInfo',
|
||||
method: 'get',
|
||||
params,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-descriptions :column="1" border v-if="bomInfo.length > 0">
|
||||
<el-descriptions-item v-for="item in bomInfo" :key="item.attrKey" :label="item.attrKey">
|
||||
{{ item.attrValue }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div v-else>
|
||||
<el-empty description="暂无参数信息" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 如果传递了bomId直接使用bomId, 如果没有传递,则根据itemType和itemId获取bomId
|
||||
import { listBomItem } from '@/api/wms/bomItem';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'BomInfo',
|
||||
props: {
|
||||
bomId: {
|
||||
type: [String, Number],
|
||||
required: false
|
||||
},
|
||||
itemType: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
itemId: {
|
||||
type: [String, Number],
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bomInfo: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('category', ['bomMap', 'productMap', 'rawMaterialMap']),
|
||||
},
|
||||
watch: {
|
||||
bomId: {
|
||||
handler: function (newVal) {
|
||||
this.getBomInfo();
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
itemId: {
|
||||
handler: function (newVal) {
|
||||
this.getBomInfo();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getBomInfo() {
|
||||
const bomMap = this.$store.getters.bomMap;
|
||||
if (!this.bomId && !this.itemType && !this.itemId) {
|
||||
return;
|
||||
}
|
||||
let bomId = this.bomId;
|
||||
if (!bomId) {
|
||||
if (this.itemType === 'product') {
|
||||
bomId = this.productMap[this.itemId]?.bomId;
|
||||
} else if (this.itemType === 'raw_material') {
|
||||
bomId = this.rawMaterialMap[this.itemId]?.bomId;
|
||||
}
|
||||
}
|
||||
if (!bomId) {
|
||||
return;
|
||||
}
|
||||
if (bomMap[bomId]) {
|
||||
this.bomInfo = bomMap[bomId];
|
||||
} else {
|
||||
listBomItem({ bomId }).then(res => {
|
||||
this.bomInfo = res.rows;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bom-info {
|
||||
cursor: pointer;
|
||||
/* 溢出隐藏显示省略号 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,96 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="bomInfo.length > 0">
|
||||
<el-tooltip :content="bomInfo.map(item => item.attrKey + ':' + item.attrValue).join(',')" class="bom-info" placement="top">
|
||||
<span>{{ bomInfo.map(item => item.attrKey).join(',') }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-else>
|
||||
-
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 如果传递了bomId直接使用bomId, 如果没有传递,则根据itemType和itemId获取bomId
|
||||
import { listBomItem } from '@/api/wms/bomItem';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'BomInfo',
|
||||
props: {
|
||||
bomId: {
|
||||
type: [String, Number],
|
||||
required: false
|
||||
},
|
||||
itemType: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
itemId: {
|
||||
type: [String, Number],
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bomInfo: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('category', ['bomMap', 'productMap', 'rawMaterialMap']),
|
||||
},
|
||||
watch: {
|
||||
bomId: {
|
||||
handler: function (newVal) {
|
||||
this.getBomInfo();
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
itemId: {
|
||||
handler: function (newVal) {
|
||||
this.getBomInfo();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getBomInfo() {
|
||||
const bomMap = this.$store.getters.bomMap;
|
||||
if (!this.bomId && !this.itemType && !this.itemId) {
|
||||
return;
|
||||
}
|
||||
let bomId = this.bomId;
|
||||
if (!bomId) {
|
||||
if (this.itemType === 'product') {
|
||||
bomId = this.productMap[this.itemId]?.bomId;
|
||||
} else if (this.itemType === 'raw_material') {
|
||||
bomId = this.rawMaterialMap[this.itemId]?.bomId;
|
||||
}
|
||||
}
|
||||
if (!bomId) {
|
||||
this.bomInfo = [];
|
||||
return;
|
||||
}
|
||||
if (bomMap[bomId]) {
|
||||
this.bomInfo = bomMap[bomId];
|
||||
} else {
|
||||
listBomItem({ bomId }).then(res => {
|
||||
this.bomInfo = res.rows;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bom-info {
|
||||
cursor: pointer;
|
||||
/* 溢出隐藏显示省略号 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,28 +0,0 @@
|
||||
<template>
|
||||
<span v-if="category">
|
||||
<slot :category="category">
|
||||
{{ category.categoryName }}
|
||||
</slot>
|
||||
</span>
|
||||
<span v-else>--</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'CategoryRenderer',
|
||||
props: {
|
||||
categoryId: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('category', ['categoryList']),
|
||||
category() {
|
||||
return this.categoryList.find(cat => String(cat.categoryId) === String(this.categoryId));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -80,16 +80,16 @@ export default {
|
||||
return this.coilNo && this.coilNo.startsWith('G');
|
||||
},
|
||||
specification() {
|
||||
return this.coilInfo.product?.specification || this.coilInfo.rawMaterial?.specification || '-'
|
||||
return this.coilInfo.specification || '-'
|
||||
},
|
||||
itemName() {
|
||||
return this.coilInfo.product?.productName || this.coilInfo.rawMaterial?.rawMaterialName || '-'
|
||||
return this.coilInfo.itemName || '-'
|
||||
},
|
||||
material() {
|
||||
return this.coilInfo.product?.material || this.coilInfo.rawMaterial?.material || '-'
|
||||
return this.coilInfo.material || '-'
|
||||
},
|
||||
manufacturer() {
|
||||
return this.coilInfo.product?.manufacturer || this.coilInfo.rawMaterial?.manufacturer || '-'
|
||||
return this.coilInfo.manufacturer || '-'
|
||||
},
|
||||
currentCoilNo() {
|
||||
return this.coilNo || this.coilInfo?.currentCoilNo || '-'
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<template>
|
||||
<el-tag>{{ getCraftInfo() }}</el-tag>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'CraftInfo',
|
||||
props: {
|
||||
craftId: {
|
||||
type: [String, Number, undefined],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['processList'])
|
||||
},
|
||||
methods: {
|
||||
getCraftInfo() {
|
||||
const craft = this.processList.find(item => item.processId === this.craftId);
|
||||
return craft.processName;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -64,9 +64,9 @@ export default {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
productId: this.product.productId || '',
|
||||
productName: this.product.productName || '',
|
||||
productCode: this.product.productCode || '',
|
||||
productId: this.product.itemId || '',
|
||||
productName: this.product.itemName || '',
|
||||
// productCode: this.product.productCode || '',
|
||||
specification: this.product.specification || '',
|
||||
material: this.product.material || '',
|
||||
surfaceTreatment: this.product.surfaceTreatmentDesc || '',
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
<template>
|
||||
<div v-loading="loading" loading-text="加载中...">
|
||||
<span class="product-name" @click.stop="clickHandle">
|
||||
<slot name="default" :product="product">
|
||||
{{ product && product.productName ? product.productName : '--' }}
|
||||
</slot>
|
||||
</span>
|
||||
<el-dialog
|
||||
:visible="showDetail"
|
||||
@close="showDetail = false"
|
||||
:title="product && product.productName ? product.productName : '--' "
|
||||
width="500px"
|
||||
append-to-body
|
||||
>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="产品名称">
|
||||
{{ product.productName || '--' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="产品编码">
|
||||
{{ product.productCode || '--' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">
|
||||
{{ product.specification || '--' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="材质">
|
||||
{{ product.material || '--' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="表面处理">
|
||||
{{ product.surfaceTreatment || '--' }}
|
||||
</el-descriptions-item>
|
||||
<!-- 锌层 -->
|
||||
<el-descriptions-item label="镀层质量">
|
||||
{{ product.zincLayer || '--' }}
|
||||
</el-descriptions-item>
|
||||
<!-- 厂家 -->
|
||||
<el-descriptions-item label="厂家">
|
||||
{{ product.manufacturer || '--' }}
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
<!-- <BomInfo :bomId="product.bomId" /> -->
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import BomInfo from './BomInfo.vue';
|
||||
|
||||
export default {
|
||||
name: 'ProductInfo',
|
||||
components: {
|
||||
BomInfo
|
||||
},
|
||||
props: {
|
||||
productId: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.productId, this.productMap);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showDetail: false,
|
||||
// product: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
productMap: state => state.category.productMap
|
||||
}),
|
||||
product() {
|
||||
// 检查 productMap 是否已加载
|
||||
if (!this.productMap || Object.keys(this.productMap).length === 0) {
|
||||
return {};
|
||||
}
|
||||
if (!this.productId) {
|
||||
return {};
|
||||
}
|
||||
return this.productMap[this.productId.toString()] || {};
|
||||
},
|
||||
loading() {
|
||||
return !this.productMap || Object.keys(this.productMap).length === 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickHandle() {
|
||||
this.showDetail = true;
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// productId: {
|
||||
// handler(newVal) {
|
||||
// if (!newVal) {
|
||||
// this.product = {};
|
||||
// }
|
||||
// const res = this.productMap[newVal.toString()] ? this.productMap[newVal.toString()] : {};
|
||||
// this.product = res;
|
||||
// },
|
||||
// immediate: true
|
||||
// }
|
||||
// }
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.product-name {
|
||||
color: #1890ff;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 可选:调整描述列表的外边距 */
|
||||
:deep(.el-descriptions) {
|
||||
margin-top: -10px;
|
||||
}
|
||||
</style>
|
||||
@@ -31,13 +31,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BomInfo from './BomInfo.vue'; // 保留导入(如需使用可解除注释)
|
||||
|
||||
export default {
|
||||
name: 'RawMaterialInfo',
|
||||
components: {
|
||||
BomInfo
|
||||
},
|
||||
props: {
|
||||
material: {
|
||||
type: Object,
|
||||
@@ -56,9 +51,9 @@ export default {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
rawMaterialId: this.material.rawMaterialId || '',
|
||||
rawMaterialName: this.material.rawMaterialName || '',
|
||||
rawMaterialCode: this.material.rawMaterialCode || '',
|
||||
rawMaterialId: this.material.itemId || '',
|
||||
rawMaterialName: this.material.itemName || '',
|
||||
// rawMaterialCode: this.material.rawMaterialCode || '',
|
||||
specification: this.material.specification || '',
|
||||
material: this.material.material || '',
|
||||
surfaceTreatment: this.material.surfaceTreatmentDesc || '',
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
<template>
|
||||
<div v-loading="loading" loading-text="加载中...">
|
||||
<!-- 作用域插槽 -->
|
||||
<span class="material-name" @click.stop="showDetail = true">
|
||||
<slot name="default" :material="material">
|
||||
{{ material.rawMaterialName ? material.rawMaterialName : '-' }}
|
||||
</slot>
|
||||
</span>
|
||||
<el-dialog :visible="showDetail" @close="showDetail = false" :title="material.rawMaterialName" width="600px"
|
||||
append-to-body>
|
||||
<el-descriptions :column="1" border>
|
||||
<!-- <el-descriptions-item label="原材料ID">{{ material.rawMaterialId }}</el-descriptions-item> -->
|
||||
<el-descriptions-item label="原材料名称">{{ material.rawMaterialName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="原材料编码">{{ material.rawMaterialCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">{{ material.specification }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材质">
|
||||
{{ material.material || '--' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="表面处理">
|
||||
{{ material.surfaceTreatment || '--' }}
|
||||
</el-descriptions-item>
|
||||
<!-- 锌层 -->
|
||||
<el-descriptions-item label="镀层质量">
|
||||
{{ material.zincLayer || '--' }}
|
||||
</el-descriptions-item>
|
||||
<!-- 厂家 -->
|
||||
<el-descriptions-item label="厂家">
|
||||
{{ material.manufacturer || '--' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<!-- <BomInfo :bomId="material.bomId" /> -->
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import BomInfo from './BomInfo.vue';
|
||||
|
||||
export default {
|
||||
name: 'RawMaterialInfo',
|
||||
components: {
|
||||
BomInfo
|
||||
},
|
||||
props: {
|
||||
materialId: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showDetail: false,
|
||||
// material: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
materialMap: state => state.category.rawMaterialMap // 假设vuex中为material模块
|
||||
}),
|
||||
material() {
|
||||
// 检查 materialMap 是否已加载
|
||||
if (!this.materialMap || Object.keys(this.materialMap).length === 0) {
|
||||
return {};
|
||||
}
|
||||
if (!this.materialId) {
|
||||
return {};
|
||||
}
|
||||
return this.materialMap[this.materialId.toString()] || {};
|
||||
},
|
||||
loading() {
|
||||
return !this.materialMap || Object.keys(this.materialMap).length === 0
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.material-name {
|
||||
color: #1890ff;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,8 @@
|
||||
export { default as CheckItemSelect } from './CheckItemSelect/index.vue';
|
||||
export { default as ProductSelect } from './ProductSelect/index.vue';
|
||||
export { default as RawMaterialSelect } from './RawMaterialSelect/index.vue';
|
||||
export { default as CategoryRenderer } from './Renderer/CategoryRenderer.vue';
|
||||
export { default as UserSelect } from './UserSelect/index.vue';
|
||||
export { default as WarehouseSelect } from './WarehouseSelect/index.vue';
|
||||
export { default as ProductInfo } from './Renderer/ProductInfo.vue';
|
||||
export { default as RawMaterialInfo } from './Renderer/RawMaterialInfo.vue';
|
||||
export { default as BomInfoMini } from './Renderer/BomInfoMini.vue';
|
||||
export { default as WarehouseTree } from './WarehouseTree/index.vue';
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
</el-table-column>
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="逻辑库区" prop="warehouseName" align="center" />
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
<!-- 物料ID/名称列:仅物料统计时有效 -->
|
||||
<el-table-column label="物料信息" align="center" min-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" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -113,9 +113,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="产品类型" align="center" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row.product" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'"
|
||||
:material="scope.row.rawMaterial" />
|
||||
:material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
@@ -293,11 +293,11 @@ export default {
|
||||
if (item.itemType === 'product') {
|
||||
summary.productTotalGrossWeight += grossWeight;
|
||||
summary.productTotalNetWeight += netWeight;
|
||||
itemName = item.product.productName;
|
||||
itemName = item.itemName || '';
|
||||
} else if (item.itemType === 'raw_material') {
|
||||
summary.rawMaterialTotalGrossWeight += grossWeight;
|
||||
summary.rawMaterialTotalNetWeight += netWeight;
|
||||
itemName = item.rawMaterial.rawMaterialName;
|
||||
itemName = item.itemName || '';
|
||||
}
|
||||
if (itemName == '冷轧卷') {
|
||||
summary.coldRollCoilCount += item.coilCount || 0;
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
min-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" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
min-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" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
min-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" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
min-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" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
<div class="detail-content">
|
||||
<ProductInfo
|
||||
v-if="coil.itemType == 'product'"
|
||||
:product="coil.product"
|
||||
:product="coil"
|
||||
/>
|
||||
<RawMaterialInfo
|
||||
v-else-if="coil.itemType === 'raw_material'"
|
||||
:material="coil.rawMaterial"
|
||||
:material="coil"
|
||||
/>
|
||||
<span v-else class="empty-text">暂无钢卷信息</span>
|
||||
</div>
|
||||
|
||||
@@ -58,66 +58,33 @@
|
||||
<el-tag type="info" size="small" class="coil-no-tag" :style="getBorderStyle(item)">{{
|
||||
getTypeLabel(item) }}</el-tag>
|
||||
<span class="material-type">{{ item.materialType || '原料' }}</span>
|
||||
<el-popover v-if="item.rawMaterial || item.product" placement="top" width="280" trigger="hover"
|
||||
popper-class="material-params-popover">
|
||||
<el-popover placement="top" width="280" trigger="hover" popper-class="material-params-popover">
|
||||
<div class="material-params-content">
|
||||
<div class="params-title">
|
||||
{{ item.itemType === 'raw_material' ? (item.rawMaterial && item.rawMaterial.rawMaterialName ||
|
||||
'—') : (item.product && item.product.productName || '—') }}
|
||||
{{ item.itemName || '—' }}
|
||||
</div>
|
||||
<div class="params-list">
|
||||
<div class="param-item" v-if="item.itemType === 'raw_material' && item.rawMaterial">
|
||||
<div class="param-row" v-if="item.rawMaterial.rawMaterialCode">
|
||||
<span class="param-label">编号:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.rawMaterialCode }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.specification">
|
||||
<div class="param-item">
|
||||
<div class="param-row" v-if="item.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.specification }}</span>
|
||||
<span class="param-value">{{ item.specification }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.material">
|
||||
<div class="param-row" v-if="item.material">
|
||||
<span class="param-label">材质:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.material }}</span>
|
||||
<span class="param-value">{{ item.material }}</span>
|
||||
</div>
|
||||
|
||||
<div class="param-row" v-if="item.rawMaterial.surfaceTreatment">
|
||||
<div class="param-row" v-if="item.surfaceTreatmentDesc">
|
||||
<span class="param-label">表面处理:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.surfaceTreatment }}</span>
|
||||
<span class="param-value">{{ item.surfaceTreatmentDesc }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.zincLayer">
|
||||
<div class="param-row" v-if="item.zincLayer">
|
||||
<span class="param-label">镀层质量:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.zincLayer }}</span>
|
||||
<span class="param-value">{{ item.zincLayer }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.manufacturer">
|
||||
<div class="param-row" v-if="item.manufacturer">
|
||||
<span class="param-label">厂家:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.manufacturer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-item" v-else-if="item.itemType === 'product' && item.product">
|
||||
<div class="param-row" v-if="item.product.productCode">
|
||||
<span class="param-label">编号:</span>
|
||||
<span class="param-value">{{ item.product.productCode }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ item.product.specification }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.material">
|
||||
<span class="param-label">材质:</span>
|
||||
<span class="param-value">{{ item.product.material }}</span>
|
||||
</div>
|
||||
|
||||
<div class="param-row" v-if="item.product.surfaceTreatment">
|
||||
<span class="param-label">表面处理:</span>
|
||||
<span class="param-value">{{ item.product.surfaceTreatment }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.zincLayer">
|
||||
<span class="param-label">镀层质量:</span>
|
||||
<span class="param-value">{{ item.product.zincLayer }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.manufacturer">
|
||||
<span class="param-label">厂家:</span>
|
||||
<span class="param-value">{{ item.product.manufacturer }}</span>
|
||||
<span class="param-value">{{ item.manufacturer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-divider"></div>
|
||||
@@ -649,7 +616,7 @@ export default {
|
||||
this.correctVisible = true;
|
||||
this.title = "添加钢卷物料";
|
||||
},
|
||||
/** 追溯按钮操作 */
|
||||
/** 追溯按钮操作 */
|
||||
handleTrace(row) {
|
||||
this.traceOpen = true;
|
||||
this.traceLoading = true;
|
||||
@@ -992,10 +959,8 @@ export default {
|
||||
},
|
||||
/** 获取物品名称 */
|
||||
getItemName(item) {
|
||||
if (item.itemType === 'product' && item.product) {
|
||||
return item.product.productName || ''
|
||||
} else if (item.itemType === 'raw_material' && item.rawMaterial) {
|
||||
return item.rawMaterial.rawMaterialName || ''
|
||||
if (item.itemName) {
|
||||
return item.itemName
|
||||
}
|
||||
return '—'
|
||||
},
|
||||
|
||||
@@ -169,24 +169,17 @@
|
||||
<div class="header-left">
|
||||
<current-coil-no :current-coil-no="item.currentCoilNo"></current-coil-no>
|
||||
<span class="material-type">{{ item.materialType || '原料' }}</span>
|
||||
<el-popover v-if="item.rawMaterial || item.product" placement="top" width="280" trigger="hover"
|
||||
<el-popover placement="top" width="280" trigger="hover"
|
||||
popper-class="material-params-popover">
|
||||
<div class="material-params-content">
|
||||
<div class="params-title">
|
||||
{{ item.itemType === 'raw_material' ? (item.rawMaterial && item.rawMaterial.rawMaterialName ||
|
||||
'—') : (item.product && item.product.productName || '—') }}
|
||||
{{ item.itemName || '—' }}
|
||||
</div>
|
||||
<div class="params-list">
|
||||
<div class="param-item" v-if="item.itemType === 'raw_material' && item.rawMaterial">
|
||||
<div class="param-row" v-if="item.rawMaterial.specification">
|
||||
<div class="param-item">
|
||||
<div class="param-row" v-if="item.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.specification }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-item" v-else-if="item.itemType === 'product' && item.product">
|
||||
<div class="param-row" v-if="item.product.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ item.product.specification }}</span>
|
||||
<span class="param-value">{{ item.specification }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-divider"></div>
|
||||
|
||||
@@ -726,8 +726,7 @@ export default {
|
||||
}
|
||||
const row = res.rows[0]
|
||||
this.labelRender.loading = false;
|
||||
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
const itemName = row.itemName || '';
|
||||
this.labelRender.type = row.itemType === 'product' ? '3' : '2'
|
||||
this.labelRender.data = {
|
||||
...row,
|
||||
@@ -744,9 +743,7 @@ export default {
|
||||
return
|
||||
}
|
||||
const row = res.rows[0]
|
||||
// this.labelRender.loading = false;
|
||||
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
const itemName = row.itemName || '';
|
||||
this.labelRender.type = row.itemType === 'product' ? '3' : '2'
|
||||
this.labelRender.data = {
|
||||
...row,
|
||||
|
||||
@@ -13,8 +13,7 @@ const ECoilPrintType = {
|
||||
* @returns 打印的标签类型
|
||||
*/
|
||||
export const getCoilTagPrintType = (coil) => {
|
||||
const item = coil.itemType === 'product' ? coil.product : coil.rawMaterial;
|
||||
const itemName = coil.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
const itemName = coil.itemName || '';
|
||||
const itemType = coil.itemType || '';
|
||||
const warehouseId = coil.warehouseId || '';
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
<div class="source-detail-row">
|
||||
<span class="detail-label">物料名称:</span>
|
||||
<span class="detail-value">{{ item.materialName || item.productName || '—' }}</span>
|
||||
<span class="detail-value">{{ item.itemName || '—' }}</span>
|
||||
</div>
|
||||
<div class="source-detail-row" v-if="item.specification">
|
||||
<span class="detail-label">物料规格:</span>
|
||||
@@ -482,8 +482,6 @@ export default {
|
||||
itemId: null,
|
||||
warehouseName: '',
|
||||
actualWarehouseName: '',
|
||||
materialName: '',
|
||||
productName: '',
|
||||
specification: '',
|
||||
grossWeight: undefined,
|
||||
netWeight: undefined,
|
||||
@@ -498,8 +496,6 @@ export default {
|
||||
itemId: null,
|
||||
warehouseName: '',
|
||||
actualWarehouseName: '',
|
||||
materialName: '',
|
||||
productName: '',
|
||||
specification: '',
|
||||
grossWeight: undefined,
|
||||
netWeight: undefined,
|
||||
@@ -538,11 +534,10 @@ export default {
|
||||
currentCoilNo: data.currentCoilNo || '',
|
||||
itemType: data.itemType,
|
||||
itemId: data.itemId,
|
||||
itemName: data.itemName || '',
|
||||
warehouseName: data.warehouseName || (data.warehouse ? data.warehouse.warehouseName : ''),
|
||||
actualWarehouseName: data.actualWarehouseName || (data.actualWarehouse ? data.actualWarehouse.warehouseName : ''),
|
||||
materialName: data.materialName || (data.rawMaterial ? data.rawMaterial.rawMaterialName : ''),
|
||||
productName: data.productName || (data.product ? data.product.productName : ''),
|
||||
specification: data.rawMaterial?.specification || data.product?.specification || '',
|
||||
specification: data?.specification || '',
|
||||
bomItems: data.bomItemList || [],
|
||||
grossWeight: data.grossWeight || null,
|
||||
netWeight: data.netWeight || null,
|
||||
@@ -557,8 +552,6 @@ export default {
|
||||
itemId: null,
|
||||
warehouseName: '',
|
||||
actualWarehouseName: '',
|
||||
materialName: '',
|
||||
productName: '',
|
||||
specification: '',
|
||||
bomItems: [],
|
||||
grossWeight: null,
|
||||
@@ -616,15 +609,13 @@ export default {
|
||||
currentCoilNo: data.currentCoilNo || '',
|
||||
itemType: data.itemType,
|
||||
itemId: data.itemId,
|
||||
itemName: data.itemName || '',
|
||||
warehouseName: data.warehouseName || (data.warehouse ? data.warehouse.warehouseName : ''),
|
||||
actualWarehouseName: data.actualWarehouseName || (data.actualWarehouse ? data.actualWarehouse.warehouseName : ''),
|
||||
materialName: data.materialName || (data.rawMaterial ? data.rawMaterial.rawMaterialName : ''),
|
||||
productName: data.productName || (data.product ? data.product.productName : ''),
|
||||
specification: data.rawMaterial?.specification || data.product?.specification || '',
|
||||
specification: data.specification || '',
|
||||
grossWeight: data.grossWeight || null,
|
||||
netWeight: data.netWeight || null,
|
||||
length: data.length || null,
|
||||
bomItems: data.bomItemList || [],
|
||||
actionId: pending.actionId // 保存待操作ID,用于后续完成操作
|
||||
});
|
||||
|
||||
@@ -653,7 +644,7 @@ export default {
|
||||
if (!item) return '';
|
||||
|
||||
// 获取名称(原材料或产品)
|
||||
const name = item.rawMaterialName || item.productName || '';
|
||||
const name = item.itemName || '';
|
||||
if (!name) return '';
|
||||
|
||||
let displayName = name;
|
||||
@@ -692,8 +683,7 @@ export default {
|
||||
itemId: null,
|
||||
warehouseName: '',
|
||||
actualWarehouseName: '',
|
||||
materialName: '',
|
||||
productName: '',
|
||||
itemName: '',
|
||||
specification: '',
|
||||
bomItems: []
|
||||
});
|
||||
@@ -799,9 +789,8 @@ export default {
|
||||
itemId: data.itemId,
|
||||
warehouseName: data.warehouseName || (data.warehouse ? data.warehouse.warehouseName : ''),
|
||||
actualWarehouseName: data.actualWarehouseName || (data.actualWarehouse ? data.actualWarehouse.warehouseName : ''),
|
||||
materialName: data.materialName || (data.rawMaterial ? data.rawMaterial.rawMaterialName : ''),
|
||||
productName: data.productName || (data.product ? data.product.productName : ''),
|
||||
specification: data.rawMaterial?.specification || data.product?.specification || '',
|
||||
itemName: data.itemName || '',
|
||||
specification: data.specification || '',
|
||||
grossWeight: data.grossWeight || null,
|
||||
netWeight: data.netWeight || null,
|
||||
length: data.length || null,
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
<el-table-column label="物料类型" align="center" prop="materialType" />
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="产品类型" align="center" min-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" />
|
||||
<ProductInfo v-if="scope.row.itemType === 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime">
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" /> -->
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="showAbnormal" label="异常数量" align="center" prop="abnormalCount"></el-table-column>
|
||||
@@ -1039,8 +1039,7 @@ export default {
|
||||
/** 预览标签 */
|
||||
handlePreviewLabel(row) {
|
||||
this.labelRender.visible = true;
|
||||
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
const itemName = row.itemName || '';
|
||||
|
||||
this.labelRender.type = row.itemType === 'product' ? '3' : '2';
|
||||
this.labelRender.data = {
|
||||
@@ -1367,8 +1366,7 @@ export default {
|
||||
const selectedData = this.materialCoilList
|
||||
.filter(item => this.ids.includes(item.coilId))
|
||||
.map(row => {
|
||||
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
const itemName = row.itemName || '';
|
||||
|
||||
return {
|
||||
...row,
|
||||
|
||||
@@ -43,66 +43,34 @@
|
||||
<div class="header-left">
|
||||
<current-coil-no :current-coil-no="item.currentCoilNo"></current-coil-no>
|
||||
<!-- <span class="material-type">{{ item.materialType || '原料' }}</span> -->
|
||||
<el-popover v-if="item.rawMaterial || item.product" placement="top" width="280" trigger="hover"
|
||||
<el-popover placement="top" width="280" trigger="hover"
|
||||
popper-class="material-params-popover">
|
||||
<div class="material-params-content">
|
||||
<div class="params-title">
|
||||
{{ item.itemType === 'raw_material' ? (item.rawMaterial && item.rawMaterial.rawMaterialName ||
|
||||
'—') : (item.product && item.product.productName || '—') }}
|
||||
{{ item.itemName || '—' }}
|
||||
</div>
|
||||
<div class="params-list">
|
||||
<div class="param-item" v-if="item.itemType === 'raw_material' && item.rawMaterial">
|
||||
<div class="param-row" v-if="item.rawMaterial.rawMaterialCode">
|
||||
<span class="param-label">编号:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.rawMaterialCode }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.specification">
|
||||
<div class="param-item">
|
||||
<div class="param-row" v-if="item.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.specification }}</span>
|
||||
<span class="param-value">{{ item.specification }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.material">
|
||||
<div class="param-row" v-if="item.material">
|
||||
<span class="param-label">材质:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.material }}</span>
|
||||
<span class="param-value">{{ item.material }}</span>
|
||||
</div>
|
||||
|
||||
<div class="param-row" v-if="item.rawMaterial.surfaceTreatment">
|
||||
<div class="param-row" v-if="item.surfaceTreatmentDesc">
|
||||
<span class="param-label">表面处理:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.surfaceTreatment }}</span>
|
||||
<span class="param-value">{{ item.surfaceTreatmentDesc }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.zincLayer">
|
||||
<div class="param-row" v-if="item.zincLayer">
|
||||
<span class="param-label">镀层质量:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.zincLayer }}</span>
|
||||
<span class="param-value">{{ item.zincLayer }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.rawMaterial.manufacturer">
|
||||
<div class="param-row" v-if="item.manufacturer">
|
||||
<span class="param-label">厂家:</span>
|
||||
<span class="param-value">{{ item.rawMaterial.manufacturer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-item" v-else-if="item.itemType === 'product' && item.product">
|
||||
<div class="param-row" v-if="item.product.productCode">
|
||||
<span class="param-label">编号:</span>
|
||||
<span class="param-value">{{ item.product.productCode }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ item.product.specification }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.material">
|
||||
<span class="param-label">材质:</span>
|
||||
<span class="param-value">{{ item.product.material }}</span>
|
||||
</div>
|
||||
|
||||
<div class="param-row" v-if="item.product.surfaceTreatment">
|
||||
<span class="param-label">表面处理:</span>
|
||||
<span class="param-value">{{ item.product.surfaceTreatment }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.zincLayer">
|
||||
<span class="param-label">镀层质量:</span>
|
||||
<span class="param-value">{{ item.product.zincLayer }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="item.product.manufacturer">
|
||||
<span class="param-label">厂家:</span>
|
||||
<span class="param-value">{{ item.product.manufacturer }}</span>
|
||||
<span class="param-value">{{ item.manufacturer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-divider"></div>
|
||||
@@ -738,8 +706,7 @@ export default {
|
||||
/** 预览标签 */
|
||||
handlePreviewLabel(row) {
|
||||
this.labelRender.visible = true;
|
||||
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
const itemName = row.itemName;
|
||||
|
||||
this.labelRender.type = row.itemType === 'product' ? '3' : '2'
|
||||
this.labelRender.data = {
|
||||
@@ -953,10 +920,8 @@ export default {
|
||||
},
|
||||
/** 获取物品名称 */
|
||||
getItemName(item) {
|
||||
if (item.itemType === 'product' && item.product) {
|
||||
return item.product.productName || ''
|
||||
} else if (item.itemType === 'raw_material' && item.rawMaterial) {
|
||||
return item.rawMaterial.rawMaterialName || ''
|
||||
if (item.itemName) {
|
||||
return item.itemName
|
||||
}
|
||||
return '—'
|
||||
},
|
||||
|
||||
@@ -140,8 +140,6 @@ export default {
|
||||
* @returns {Object} 格式化后的钢卷对象
|
||||
*/
|
||||
formatCoilData(coil) {
|
||||
const product = coil.product || {}
|
||||
const rawMaterial = coil.rawMaterial || {}
|
||||
const warehouse = coil.warehouse || {}
|
||||
|
||||
return {
|
||||
|
||||
@@ -513,15 +513,13 @@ export default {
|
||||
itemType: data.itemType,
|
||||
itemId: data.itemId,
|
||||
materialType: data.materialType,
|
||||
materialName: data.materialName || (data.rawMaterial ? data.rawMaterial.rawMaterialName : ''),
|
||||
productName: data.productName || (data.product ? data.product.productName : ''),
|
||||
itemName: data.itemName || '',
|
||||
grossWeight: data.grossWeight,
|
||||
netWeight: data.netWeight,
|
||||
length: data.length,
|
||||
itemName: data?.rawMaterial?.rawMaterialName || data?.product?.productName || '',
|
||||
itemManufacturer: data?.rawMaterial?.manufacturer || data?.product?.manufacturer || '',
|
||||
itemMaterial: data?.rawMaterial?.material || data?.product?.material || '',
|
||||
itemSpecification: data?.rawMaterial?.specification || data?.product?.specification || '',
|
||||
itemManufacturer: data?.manufacturer || '',
|
||||
itemMaterial: data?.material || '',
|
||||
itemSpecification: data?.specification || '',
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -665,10 +665,8 @@ export default {
|
||||
|
||||
// 获取物料名称
|
||||
getItemName(data) {
|
||||
if (data.rawMaterial) {
|
||||
return data.rawMaterial.rawMaterialName;
|
||||
} else if (data.product) {
|
||||
return data.product.productName;
|
||||
if (data.itemName) {
|
||||
return data.itemName;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime">
|
||||
@@ -148,8 +148,8 @@
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime">
|
||||
|
||||
@@ -79,22 +79,22 @@ export default {
|
||||
switch (this.selectedType) {
|
||||
case 'itemName':
|
||||
targetValue = itemType === 'product'
|
||||
? (item.product?.productName || item.product?.name || '无名称')
|
||||
? (item.itemName || '无名称')
|
||||
: (item.itemName || '无名称')
|
||||
break
|
||||
case 'specification':
|
||||
targetValue = itemType === 'product'
|
||||
? (item.product?.specification || '无规格')
|
||||
? (item.specification || '无规格')
|
||||
: (item.specification || '无规格')
|
||||
break
|
||||
case 'material':
|
||||
targetValue = itemType === 'product'
|
||||
? (item.product?.material || '无材质')
|
||||
? (item.material || '无材质')
|
||||
: (item.material || '无材质')
|
||||
break
|
||||
case 'manufacturer':
|
||||
targetValue = itemType === 'product'
|
||||
? (item.product?.manufacturer || '无厂家')
|
||||
? (item.manufacturer || '无厂家')
|
||||
: (item.manufacturer || '无厂家')
|
||||
break
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
|
||||
@@ -60,11 +60,6 @@
|
||||
<ProductInfo :product-id="scope.row.productId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<BomInfoMini item-type="product" :item-id="scope.row.productId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品数量" align="center" prop="quantity" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="含税单价" align="center" prop="taxPrice" />
|
||||
@@ -140,7 +135,6 @@ import { getOrder } from "@/api/wms/order";
|
||||
import ProductSelect from '@/components/KLPService/ProductSelect';
|
||||
import { EOrderStatus } from "@/utils/enums";
|
||||
import { ProductInfo } from '@/components/KLPService';
|
||||
import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
||||
import ProductSpec from './spec.vue';
|
||||
import KLPTable from '@/components/KLPUI/KLPTable/index.vue';
|
||||
|
||||
@@ -160,7 +154,6 @@ export default {
|
||||
components: {
|
||||
ProductSelect,
|
||||
ProductInfo,
|
||||
BomInfoMini,
|
||||
ProductSpec,
|
||||
KLPTable
|
||||
},
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
</el-table-column>
|
||||
<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" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="品名" align="center" prop="itemName" min-width="100" />
|
||||
@@ -284,8 +284,6 @@ export default {
|
||||
fromWarehouseName: coil.warehouseName || '',
|
||||
itemType: coil.itemType || '',
|
||||
itemId: coil.itemId || '',
|
||||
product: coil.product || {},
|
||||
rawMaterial: coil.rawMaterial || {},
|
||||
// beforePosition: coil.actualWarehouseName || '',
|
||||
toWarehouseId: '2035892198703349761',
|
||||
toWarehouseName: '打包待发货'
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="产品类型" align="center" width="280">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.coil.itemType == 'product'" :product="scope.row.coil.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.coil.itemType === 'raw_material'" :material="scope.row.coil.rawMaterial" />
|
||||
<ProductInfo v-if="scope.row.coil.itemType == 'product'" :product="scope.row.coil" />
|
||||
<RawMaterialInfo v-else-if="scope.row.coil.itemType === 'raw_material'" :material="scope.row.coil" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量" align="center" prop="coilNetWeight" width="80"></el-table-column>
|
||||
@@ -325,8 +325,6 @@ export default {
|
||||
fromWarehouseName: coil.actualWarehouseName || '',
|
||||
toWarehouseName: '打包待发货',
|
||||
itemType: coil.itemType,
|
||||
product: coil.product,
|
||||
rawMaterial: coil.rawMaterial,
|
||||
saleName: '',
|
||||
coil,
|
||||
// 注意:这里不设置detailId,标识为未保存状态
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<div style="position: absolute; top: 10px; left: 10px;">
|
||||
<!-- 策略切换单选框 -->
|
||||
<el-radio-group
|
||||
v-model="currentStrategy"
|
||||
size="mini"
|
||||
>
|
||||
<el-radio label="stockIo">盘点单</el-radio>
|
||||
<el-radio label="order">订单</el-radio>
|
||||
<el-radio label="purchase">采购计划</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
<!-- 动态下拉选择框,根据策略切换数据源 -->
|
||||
<el-select
|
||||
v-model="currentId"
|
||||
:placeholder="`请选择${strategyLabels[currentStrategy]}`"
|
||||
style="width: 200px;"
|
||||
size="mini"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in currentList"
|
||||
:key="item[keyField]"
|
||||
:label="item[labelField]"
|
||||
:value="item[keyField]"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="print-container" v-loading="loading">
|
||||
<BarCode :barcodes="drawerBarcodeData" @delete="handleDelete" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BarCode from '../stockIo/panels/barcode.vue';
|
||||
import { listStockIo } from '@/api/wms/stockIo';
|
||||
import { listStockIoDetail } from '@/api/wms/stockIoDetail';
|
||||
import { listOrder } from '@/api/wms/order';
|
||||
import { listOrderDetail } from '@/api/wms/orderDetail';
|
||||
import { mapState } from 'vuex';
|
||||
import { ITEM_TYPE } from '../../../utils/enums';
|
||||
|
||||
// 策略配置 - 集中管理各策略的元数据
|
||||
const strategyMetadata = {
|
||||
stockIo: {
|
||||
label: '盘点单',
|
||||
listKey: 'stockIoList',
|
||||
keyField: 'stockIoId',
|
||||
labelField: 'stockIoCode'
|
||||
},
|
||||
order: {
|
||||
label: '订单',
|
||||
listKey: 'orderList',
|
||||
keyField: 'orderId',
|
||||
labelField: 'orderCode'
|
||||
},
|
||||
purchase: {
|
||||
label: '采购计划',
|
||||
listKey: 'purchaseList',
|
||||
keyField: 'planId',
|
||||
labelField: 'planCode'
|
||||
}
|
||||
};
|
||||
|
||||
// 策略实现 - 封装各策略的具体业务逻辑
|
||||
const strategies = {
|
||||
stockIo: {
|
||||
// 加载列表数据
|
||||
list: (vm) => {
|
||||
if (vm.stockIoList.length) return;
|
||||
vm.loading = true;
|
||||
listStockIo({ pageNum: 1, pageSize: 9999 }).then(res => {
|
||||
vm.stockIoList = res.rows || [];
|
||||
}).finally(() => {
|
||||
vm.loading = false;
|
||||
});
|
||||
},
|
||||
// 获取条码数据
|
||||
getBarcodeData: (vm) => {
|
||||
if (!vm.currentId) return;
|
||||
vm.loading = true;
|
||||
listStockIoDetail({ stockIoId: vm.currentId }).then(res => {
|
||||
const details = res.rows || [];
|
||||
vm.drawerBarcodeData = details
|
||||
.filter(el => el.recordType === 0)
|
||||
.map(item => ({
|
||||
code: encodeURIComponent(`${item.itemType}__${item.itemId || ''}`),
|
||||
count: Math.min(item.quantity, 10),
|
||||
textTpl: item.itemType === ITEM_TYPE.PRODUCT
|
||||
? `${vm.productMap[item.itemId]?.productName}[${vm.productMap[item.itemId]?.productCode}](${item.quantity})`
|
||||
: `${vm.rawMaterialMap[item.itemId]?.rawMaterialName}[${vm.rawMaterialMap[item.itemId]?.rawMaterialCode}](${item.quantity})`
|
||||
}));
|
||||
}).finally(() => {
|
||||
vm.loading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
order: {
|
||||
list: (vm) => {
|
||||
if (vm.orderList.length) return;
|
||||
vm.loading = true;
|
||||
listOrder({ pageNum: 1, pageSize: 9999 }).then(res => {
|
||||
vm.orderList = res.rows || [];
|
||||
}).finally(() => {
|
||||
vm.loading = false;
|
||||
});
|
||||
},
|
||||
getBarcodeData: (vm) => {
|
||||
if (!vm.currentId) return;
|
||||
vm.loading = true;
|
||||
listOrderDetail({ orderId: vm.currentId }).then(res => {
|
||||
const details = res.rows || [];
|
||||
vm.drawerBarcodeData = details.map(item => ({
|
||||
code: encodeURIComponent(`product__${item.productId || ''}`),
|
||||
count: Math.min(item.quantity, 10),
|
||||
textTpl: `${vm.productMap[item.productId]?.productName}[${vm.productMap[item.productId]?.productCode}](${item.quantity})`
|
||||
}));
|
||||
}).finally(() => {
|
||||
vm.loading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
purchase: {
|
||||
list: (vm) => {
|
||||
if (vm.purchaseList.length) return;
|
||||
vm.loading = true;
|
||||
listPurchasePlan({ pageNum: 1, pageSize: 9999 }).then(res => {
|
||||
vm.purchaseList = res.rows || [];
|
||||
}).finally(() => {
|
||||
vm.loading = false;
|
||||
});
|
||||
},
|
||||
getBarcodeData: (vm) => {
|
||||
if (!vm.currentId) return;
|
||||
vm.loading = true;
|
||||
listPurchasePlanDetail({ planId: vm.currentId }).then(res => {
|
||||
const details = res.rows || [];
|
||||
vm.drawerBarcodeData = details.map(item => ({
|
||||
code: encodeURIComponent(`raw_material__${item.rawMaterialId || ''}`),
|
||||
count: Math.min(item.quantity, 10),
|
||||
textTpl: `${vm.rawMaterialMap[item.rawMaterialId]?.rawMaterialName}[${vm.rawMaterialMap[item.rawMaterialId]?.rawMaterialCode}](${item.quantity})`
|
||||
}));
|
||||
}).finally(() => {
|
||||
vm.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Print',
|
||||
components: { BarCode },
|
||||
data() {
|
||||
return {
|
||||
currentStrategy: 'stockIo', // 默认策略
|
||||
currentId: '', // 当前选中的ID
|
||||
stockIoList: [], // 盘点单列表
|
||||
orderList: [], // 订单列表
|
||||
purchaseList: [], // 采购计划列表
|
||||
drawerBarcodeData: [], // 条码数据
|
||||
loading: false // 加载状态
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
rawMaterialMap: state => state.category.rawMaterialMap,
|
||||
productMap: state => state.category.productMap
|
||||
}),
|
||||
// 策略标签映射
|
||||
strategyLabels() {
|
||||
return Object.keys(strategyMetadata).reduce((obj, key) => {
|
||||
obj[key] = strategyMetadata[key].label;
|
||||
return obj;
|
||||
}, {});
|
||||
},
|
||||
// 当前策略对应的列表数据
|
||||
currentList() {
|
||||
return this[strategyMetadata[this.currentStrategy].listKey] || [];
|
||||
},
|
||||
// 当前策略的主键字段
|
||||
keyField() {
|
||||
return strategyMetadata[this.currentStrategy].keyField;
|
||||
},
|
||||
// 当前策略的显示字段
|
||||
labelField() {
|
||||
return strategyMetadata[this.currentStrategy].labelField;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 策略切换时的处理
|
||||
currentStrategy: {
|
||||
handler(newVal) {
|
||||
this.currentId = ''; // 清空选择
|
||||
this.drawerBarcodeData = []; // 清空条码数据
|
||||
// 加载对应策略的列表数据
|
||||
if (strategies[newVal]?.list) {
|
||||
strategies[newVal].list(this);
|
||||
}
|
||||
},
|
||||
immediate: true // 初始化时执行
|
||||
},
|
||||
// 选中项变化时的处理
|
||||
currentId(newVal) {
|
||||
if (!newVal) {
|
||||
this.drawerBarcodeData = [];
|
||||
return;
|
||||
}
|
||||
// 获取对应策略的条码数据
|
||||
if (strategies[this.currentStrategy]?.getBarcodeData) {
|
||||
strategies[this.currentStrategy].getBarcodeData(this);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleDelete(cfg, idx) {
|
||||
this.drawerBarcodeData.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.print-container {
|
||||
margin-top: 20px;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,70 +0,0 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<!-- 录入二维码列表 -->
|
||||
<el-form inline style="position: relative;">
|
||||
<el-form-item label="物料类型">
|
||||
<el-select v-model="itemType" placeholder="请选择物料类型" clearable>
|
||||
<el-option v-for="dict in dict.type.stock_item_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料信息">
|
||||
<ProductSelect can-add v-if="itemType === 'product'" v-model="itemId" placeholder="请选择产品"
|
||||
@change="onItemChange" />
|
||||
<SemiSelect can-add v-else-if="itemType === 'semi'" v-model="itemId" placeholder="请选择半成品"
|
||||
@change="onItemChange" />
|
||||
<RawMaterialSelect can-add v-else-if="itemType === 'raw_material'" v-model="itemId" placeholder="请选择原材料"
|
||||
@change="onItemChange" />
|
||||
<el-input v-else disabled v-model="itemId" placeholder="请先选择物料类型" :disabled="true" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="print-container" v-loading="loading">
|
||||
<BarCode :barcodes="drawerBarcodeData" @delete="handleDelete" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BarCode from '../stockIo/panels/barcode.vue';
|
||||
import ProductSelect from '@/components/KLPService/ProductSelect/index.vue';
|
||||
import SemiSelect from '@/components/KLPService/SemiSelect/index.vue';
|
||||
import RawMaterialSelect from '@/components/KLPService/RawMaterialSelect/index.vue';
|
||||
|
||||
export default {
|
||||
name: 'Print',
|
||||
components: { BarCode, ProductSelect, SemiSelect, RawMaterialSelect },
|
||||
dicts: ['stock_item_type'],
|
||||
data() {
|
||||
return {
|
||||
drawerBarcodeData: [], // 条码数据
|
||||
loading: false, // 加载状态
|
||||
itemId: undefined, // 物料ID
|
||||
itemType: undefined, // 物料类型
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onItemChange(item) {
|
||||
// 选中后构造条码数据并插入
|
||||
console.log(item);
|
||||
const itemType = this.itemType;
|
||||
const name = (itemType == 'semi' || itemType == 'product') ? item.productName : item.rawMaterialName;
|
||||
const code = (itemType == 'semi' || itemType == 'product') ? item.productCode : item.rawMaterialCode;
|
||||
const itemId = (itemType == 'semi' || itemType == 'product') ? item.productId : item.rawMaterialId;
|
||||
const o = {
|
||||
code: encodeURIComponent(`${itemType}__${itemId || ''}`),
|
||||
count: 1,
|
||||
textTpl: `${name}[${code}]`
|
||||
}
|
||||
this.drawerBarcodeData.push(o);
|
||||
},
|
||||
handleDelete(cfg, idx) {
|
||||
console.log(cfg, idx);
|
||||
this.drawerBarcodeData.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
@@ -65,11 +65,6 @@
|
||||
<dict-tag :options="dict.type.common_swicth" :value="scope.row.isEnabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="参数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<BomInfoMini :bomId="scope.row.bomId" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
@@ -85,18 +80,11 @@
|
||||
<!-- 添加或修改产品对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<!-- <el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="负责人" prop="owner">
|
||||
<el-input v-model="form.owner" :multiple="false" placeholder="请填写负责人" />
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
@@ -127,28 +115,17 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- <el-dialog title="参数" @close="bomDialogVisible = false" :visible.sync="bomDialogVisible" width="600px"
|
||||
append-to-body>
|
||||
<BomPanel :id="bomId" type="product" @addBom="handleAddBom" :itemId="itemId" />
|
||||
</el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProduct, getProduct, delProduct, updateProduct, addProductWithBom } from "@/api/wms/product";
|
||||
import CategoryRenderer from '@/components/KLPService/Renderer/CategoryRenderer.vue';
|
||||
import UserSelect from '@/components/KLPService/UserSelect';
|
||||
// import BomPanel from '../bom/components/BomPanel.vue';
|
||||
// import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
||||
|
||||
export default {
|
||||
name: "Product",
|
||||
components: {
|
||||
CategoryRenderer,
|
||||
UserSelect,
|
||||
// BomPanel,
|
||||
// BomInfoMini
|
||||
},
|
||||
dicts: ['common_swicth'],
|
||||
data() {
|
||||
|
||||
@@ -92,11 +92,6 @@
|
||||
<el-table-column label="厂家" align="center" prop="manufacturer" />
|
||||
<el-table-column label="表面处理" align="center" prop="surfaceTreatmentDesc" />
|
||||
<el-table-column label="镀层质量" align="center" prop="zincLayer" />
|
||||
<!-- <el-table-column label="参数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<BomInfoMini :bomId="scope.row.bomId" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@@ -166,13 +161,9 @@
|
||||
|
||||
<script>
|
||||
import { listRawMaterial, getRawMaterial, delRawMaterial, updateRawMaterial, addRawMaterialWithBom } from "@/api/wms/rawMaterial";
|
||||
import CategoryRenderer from '@/components/KLPService/Renderer/CategoryRenderer.vue';
|
||||
|
||||
export default {
|
||||
name: "RawMaterial",
|
||||
components: {
|
||||
CategoryRenderer,
|
||||
},
|
||||
dicts: ['common_swicth'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -165,9 +165,7 @@ export default {
|
||||
...item,
|
||||
quantity: 1, // 默认数量为1
|
||||
...results[index].data,
|
||||
...results[index].data.rawMaterial,
|
||||
...results[index].data.product,
|
||||
itemName: results[index].data.rawMaterial?.rawMaterialName || results[index].data.product?.productName || ''
|
||||
itemName: results[index].data.itemName || ''
|
||||
}));
|
||||
console.log(this.localWaybillDetails);
|
||||
this.loading = false;
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
<current-coil-no :current-coil-no="scope.row.currentCoilNo"></current-coil-no>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'itemId'">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'status'">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import { listCoilWithIds, listWithBindInfoCoil } from "@/api/wms/coil";
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
@@ -160,7 +160,7 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
listCoilWithIds({
|
||||
listWithBindInfoCoil({
|
||||
...this.queryParams
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<script>
|
||||
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
|
||||
import { dugeConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveReport',
|
||||
@@ -17,20 +18,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [505, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'dugekuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'dugekuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1988151132361519105', label: '镀铬成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...dugeConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
105
klp-ui/src/views/wms/report/js/config.js
Normal file
105
klp-ui/src/views/wms/report/js/config.js
Normal file
@@ -0,0 +1,105 @@
|
||||
export const dugeConfig = {
|
||||
actionTypes: [505, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'dugekuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'dugekuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988151132361519105', label: '镀铬成品库' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
}
|
||||
|
||||
export const lajiaoConfig = {
|
||||
actionTypes: [503, 120],
|
||||
actionQueryParams: {
|
||||
updateBy: 'lajiaokuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'lajiaokuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988150915591499777', label: '拉矫成品库' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
}
|
||||
|
||||
export const shuangConfig = {
|
||||
actionTypes: [504, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'shuangkuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'shuangkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1992873437713080322', label: '双机架成品库' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
}
|
||||
|
||||
export const tuozhiConfig = {
|
||||
actionTypes: [502, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'tuozhikuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'tuozhikuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988150586938421250', label: '脱脂成品库' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
}
|
||||
|
||||
export const suanzhaConfig = {
|
||||
actionTypes: [11, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'suanzhakuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'suanzhakuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ label: '酸连轧成品库', value: '1988150099140866050' },
|
||||
{ label: '镀锌原料库', value: '1988150263284953089' },
|
||||
{ label: '脱脂原料库', value: '1988150545175736322' },
|
||||
{ label: '酸连轧纵剪分条原料库', value: '1988150150521090049' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
}
|
||||
|
||||
export const zincConfig = {
|
||||
actionTypes: [501, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'duxinkuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'duxinkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988150323162836993', label: '镀锌成品库' },
|
||||
{ value: '1988150487185289217', label: '镀锌纵剪分条原料库' },
|
||||
{ value: '2019583656787259393', label: '技术部' },
|
||||
{ value: '2019583325311414274', label: '小钢卷库' },
|
||||
{ value: '2019583429955104769', label: '废品库' },
|
||||
{ value: '2019583137616310273', label: '退货库' },
|
||||
],
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<script>
|
||||
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
|
||||
import { lajiaoConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveReport',
|
||||
@@ -17,20 +18,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [503, 120],
|
||||
actionQueryParams: {
|
||||
updateBy: 'lajiaokuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'lajiaokuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1988150915591499777', label: '拉矫成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...lajiaoConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<script>
|
||||
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
|
||||
import { shuangConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ShuangComprehensiveReport',
|
||||
@@ -17,20 +18,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [504, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'shuangkuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'shuangkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1992873437713080322', label: '双机架成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...shuangConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<script>
|
||||
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
|
||||
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveReport',
|
||||
@@ -17,20 +18,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [502, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'tuozhikuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'tuozhikuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1988150586938421250', label: '脱脂成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...tuozhiConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<script>
|
||||
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
|
||||
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveReport',
|
||||
@@ -17,23 +18,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [11, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'suanzhakuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'suanzhakuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ label: '酸连轧成品库', value: '1988150099140866050' },
|
||||
{ label: '镀锌原料库', value: '1988150263284953089' },
|
||||
{ label: '脱脂原料库', value: '1988150545175736322' },
|
||||
{ label: '酸连轧纵剪分条原料库', value: '1988150150521090049' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...suanzhaConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
klp-ui/src/views/wms/report/zha/loss.vue
Normal file
25
klp-ui/src/views/wms/report/zha/loss.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
components: {
|
||||
LossTemplate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [11, 120],
|
||||
actionQueryParams: {
|
||||
updateBy: 'suanzhakuguan'
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
34
klp-ui/src/views/wms/report/zha/out.vue
Normal file
34
klp-ui/src/views/wms/report/zha/out.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
components: {
|
||||
OutTemplate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'suanzhakuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ label: '酸连轧成品库', value: '1988150099140866050' },
|
||||
{ label: '镀锌原料库', value: '1988150263284953089' },
|
||||
{ label: '脱脂原料库', value: '1988150545175736322' },
|
||||
{ label: '酸连轧纵剪分条原料库', value: '1988150150521090049' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<script>
|
||||
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
|
||||
import { zincConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveReport',
|
||||
@@ -17,21 +18,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [501, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'duxinkuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'duxinkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988150323162836993', label: '镀锌成品库' },
|
||||
{ value: '1988150487185289217', label: '镀锌纵剪分条原料库' },
|
||||
{ value: '2019583656787259393', label: '技术部' },
|
||||
{ value: '2019583325311414274', label: '小钢卷库' },
|
||||
{ value: '2019583429955104769', label: '废品库' },
|
||||
{ value: '2019583137616310273', label: '退货库' },
|
||||
],
|
||||
...zincConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
klp-ui/src/views/wms/report/zinc/loss.vue
Normal file
25
klp-ui/src/views/wms/report/zinc/loss.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
components: {
|
||||
LossTemplate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [501, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'duxinkuguan'
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
32
klp-ui/src/views/wms/report/zinc/out.vue
Normal file
32
klp-ui/src/views/wms/report/zinc/out.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
components: {
|
||||
OutTemplate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'duxinkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988150323162836993', label: '镀锌成品库' },
|
||||
{ value: '1988150487185289217', label: '镀锌纵剪分条原料库' },
|
||||
{ value: '2019583656787259393', label: '技术部' },
|
||||
{ value: '2019583325311414274', label: '小钢卷库' },
|
||||
{ value: '2019583429955104769', label: '废品库' },
|
||||
{ value: '2019583137616310273', label: '退货库' },
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -42,11 +42,6 @@
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数">
|
||||
<template slot-scope="scope">
|
||||
<BomInfoMini :itemType="scope.row.itemType" :itemId="scope.row.itemId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" align="center" prop="totalQuantity" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@@ -84,7 +79,6 @@ import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||
import WarehouseSelect from "@/components/WarehouseSelect";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import BomInfoMini from "@/components/KLPService/Renderer/BomInfoMini";
|
||||
import StockIo from './panels/stockIo.vue';
|
||||
import WarehouseTree from "@/components/KLPService/WarehouseTree/index.vue";
|
||||
import MaterialSelect from "@/components/KLPService/MaterialSelect";
|
||||
@@ -101,7 +95,6 @@ export default {
|
||||
ProductSelect,
|
||||
RawMaterialInfo,
|
||||
ProductInfo,
|
||||
BomInfoMini,
|
||||
StockIo,
|
||||
WarehouseTree,
|
||||
MaterialSelect,
|
||||
@@ -174,6 +167,8 @@ export default {
|
||||
item.rawMaterial = {
|
||||
rawMaterialId: item.itemId,
|
||||
rawMaterialName: item.itemName,
|
||||
itemId: item.itemId,
|
||||
itemName: item.itemName,
|
||||
rawMaterialCode: item.itemCode,
|
||||
specification: item.specification,
|
||||
material: item.material,
|
||||
@@ -186,6 +181,8 @@ export default {
|
||||
productId: item.itemId,
|
||||
productName: item.itemName,
|
||||
productCode: item.itemCode,
|
||||
itemId: item.itemId,
|
||||
itemName: item.itemName,
|
||||
specification: item.specification,
|
||||
material: item.material,
|
||||
surfaceTreatment: item.surfaceTreatment,
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<template>
|
||||
<StockIoPage ioType="in" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StockIoPage from './panels/stockIoPage.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
StockIoPage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,488 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="单号" prop="stockIoCode">
|
||||
<el-input
|
||||
v-model="queryParams.stockIoCode"
|
||||
placeholder="请输入出入库单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="ioType">
|
||||
<el-select v-model="queryParams.ioType" placeholder="请选择类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_io_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-select v-model="queryParams.bizType" placeholder="请选择业务类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_biz_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择单据状态" clearable>
|
||||
<el-option :key="0" label="草稿" :value="0" />
|
||||
<el-option :key="1" label="待审核" :value="1" />
|
||||
<el-option :key="2" label="已完成" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="stockIoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="出入库单ID" align="center" prop="stockIoId" v-if="true"/>
|
||||
<el-table-column label="出入库单号" align="center" prop="stockIoCode" />
|
||||
<el-table-column label="类型" align="center" prop="ioType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getIoTypeTagType(scope.row.ioType)">
|
||||
{{ getIoTypeLabel(scope.row.ioType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务类型" align="center" prop="bizType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getBizTypeTagType(scope.row.bizType)">
|
||||
{{ getBizTypeLabel(scope.row.bizType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 2 ? 'success' : (scope.row.status === 1 ? 'warning' : 'info')">
|
||||
{{ scope.row.status === 2 ? '已完成' : (scope.row.status === 0 ? '草稿' : '待审核') }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-document"
|
||||
@click="showDetail(scope.row)"
|
||||
>明细</el-button>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-printer"
|
||||
@click="handleShowBarcodeDrawer(scope.row)"
|
||||
>打印条码</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改出入库单主对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="出入库单号" prop="stockIoCode">
|
||||
<el-input v-model="form.stockIoCode" placeholder="请输入出入库单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="ioType">
|
||||
<el-select v-model="form.ioType" placeholder="请选择类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_io_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-select v-model="form.bizType" placeholder="请选择业务类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_biz_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-input v-model="form.status" :value="0" readonly disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 明细弹窗 -->
|
||||
<el-dialog
|
||||
title="出入库单详情"
|
||||
:visible.sync="detailDialogVisible"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
@close="onDetailClosed"
|
||||
>
|
||||
<StockIoDetailPanel
|
||||
:stockIo="detailStockIo"
|
||||
@status-changed="onStatusChanged"
|
||||
/>
|
||||
</el-dialog>
|
||||
<!-- 条码打印抽屉 -->
|
||||
<!-- <el-drawer
|
||||
title="条码打印"
|
||||
:visible.sync="drawerBarcodeVisible"
|
||||
size="100%"
|
||||
direction="btt"
|
||||
:with-header="true"
|
||||
>
|
||||
<BarcodeGenerator
|
||||
v-if="drawerBarcodeVisible"
|
||||
:barcodes="drawerBarcodeData.barcodes"
|
||||
:perRow="drawerBarcodeData.perRow"
|
||||
:barcodeWidth="drawerBarcodeData.barcodeWidth"
|
||||
:barcodeHeight="drawerBarcodeData.barcodeHeight"
|
||||
/>
|
||||
</el-drawer> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockIo, getStockIo, delStockIo, addStockIo, updateStockIo } from "@/api/wms/stockIo";
|
||||
import { listStockIoDetail } from "@/api/wms/stockIoDetail";
|
||||
import StockIoDetailPanel from './panels/detail.vue';
|
||||
import BarcodeGenerator from './panels/barcode.vue';
|
||||
|
||||
export default {
|
||||
name: "StockIo",
|
||||
dicts: ['stock_biz_type', 'stock_io_type', 'stock_status'],
|
||||
components: { StockIoDetailPanel, BarcodeGenerator },
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 出入库单主表格数据
|
||||
stockIoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
stockIoCode: undefined,
|
||||
ioType: undefined,
|
||||
bizType: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockIoId: [
|
||||
{ required: true, message: "出入库单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
stockIoCode: [
|
||||
{ required: true, message: "出入库单号不能为空", trigger: "blur" }
|
||||
],
|
||||
ioType: [
|
||||
{ required: true, message: "类型不能为空", trigger: "change" }
|
||||
],
|
||||
bizType: [
|
||||
{ required: true, message: "业务类型不能为空", trigger: "change" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "单据状态不能为空", trigger: "change" }
|
||||
],
|
||||
delFlag: [
|
||||
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
detailDialogVisible: false,
|
||||
detailStockIo: null,
|
||||
// 条码打印抽屉相关
|
||||
// drawerBarcodeVisible: false,
|
||||
// drawerBarcodeData: {
|
||||
// barcodes: [],
|
||||
// perRow: 3,
|
||||
// barcodeWidth: 180,
|
||||
// barcodeHeight: 60
|
||||
// },
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询出入库单主列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStockIo(this.queryParams).then(response => {
|
||||
this.stockIoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockIoId: undefined,
|
||||
stockIoCode: undefined,
|
||||
ioType: undefined,
|
||||
bizType: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stockIoId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.status = 0; // 新增时默认草稿状态
|
||||
this.open = true;
|
||||
this.title = "添加出入库单主";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const stockIoId = row.stockIoId || this.ids
|
||||
getStockIo(stockIoId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改出入库单主";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.stockIoId != null) {
|
||||
updateStockIo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addStockIo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockIoIds = row.stockIoId || this.ids;
|
||||
this.$modal.confirm('是否确认删除出入库单主编号为"' + stockIoIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delStockIo(stockIoIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/stockIo/export', {
|
||||
...this.queryParams
|
||||
}, `stockIo_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
showDetail(row) {
|
||||
this.detailStockIo = { ...row };
|
||||
this.detailDialogVisible = true;
|
||||
},
|
||||
onDetailClosed() {
|
||||
this.getList();
|
||||
},
|
||||
onStatusChanged(updatedStockIo) {
|
||||
// 更新主表中的对应记录状态
|
||||
const index = this.stockIoList.findIndex(item => item.stockIoId === updatedStockIo.stockIoId);
|
||||
if (index !== -1) {
|
||||
this.$set(this.stockIoList, index, updatedStockIo);
|
||||
}
|
||||
// 刷新列表
|
||||
this.getList();
|
||||
},
|
||||
// async handleShowBarcodeDrawer(row) {
|
||||
// // 获取明细列表
|
||||
// const res = await listStockIoDetail({ stockIoId: row.stockIoId });
|
||||
// const details = res.data || res.rows || [];
|
||||
// // 拼接条码内容 stockIoId_warehouseId_materialId_quantity
|
||||
// const barcodes = details.filter(el => el.recordType == 0).map(item => {
|
||||
// return encodeURIComponent(`${row.stockIoId}_${item.warehouseId || ''}_${item.itemId || ''}_${item.quantity || ''}`);
|
||||
// });
|
||||
// // this.drawerBarcodeData = {
|
||||
// // barcodes,
|
||||
// // perRow: 3,
|
||||
// // barcodeWidth: 180,
|
||||
// // barcodeHeight: 60
|
||||
// // };
|
||||
// // this.drawerBarcodeVisible = true;
|
||||
// },
|
||||
getIoTypeTagType(type) {
|
||||
if (type === 'in') return 'success';
|
||||
if (type === 'out') return 'primary';
|
||||
if (type === 'transfer') return 'warning';
|
||||
return '';
|
||||
},
|
||||
getIoTypeLabel(type) {
|
||||
if (type === 'in') return '入库';
|
||||
if (type === 'out') return '出库';
|
||||
if (type === 'transfer') return '移库';
|
||||
return type;
|
||||
},
|
||||
getBizTypeTagType(type) {
|
||||
if (type === 'purchase') return 'success';
|
||||
if (type === 'sales') return 'primary';
|
||||
if (type === 'return') return 'warning';
|
||||
if (type === 'relocation') return 'info';
|
||||
return 'default';
|
||||
},
|
||||
getBizTypeLabel(type) {
|
||||
const map = {
|
||||
purchase: '采购',
|
||||
sales: '销售',
|
||||
return: '退货',
|
||||
relocation: '调拨',
|
||||
other: '其他'
|
||||
};
|
||||
return map[type] || type;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,13 +0,0 @@
|
||||
<template>
|
||||
<StockIoPage ioType="transfer" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StockIoPage from './panels/stockIoPage.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
StockIoPage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,13 +0,0 @@
|
||||
<template>
|
||||
<StockIoPage ioType="out" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StockIoPage from './panels/stockIoPage.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
StockIoPage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,424 +0,0 @@
|
||||
<template>
|
||||
<div class="barcode-3col-layout">
|
||||
<!-- 预览区 -->
|
||||
<div class="barcode-preview-col">
|
||||
<div class="iframe-wrapper">
|
||||
<iframe ref="previewIframe" class="barcode-iframe" frameborder="0" :style="iframeStyle"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧控制+设置区 -->
|
||||
<div class="barcode-right-col">
|
||||
<!-- 控制区 -->
|
||||
<div class="barcode-control-bar">
|
||||
<el-tabs v-model="activeTab" stretch>
|
||||
<el-tab-pane label="排版设置" name="layout" />
|
||||
<el-tab-pane label="二维码明细" name="detail" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
<!-- 设置区 -->
|
||||
<div class="barcode-settings-panel">
|
||||
<el-form v-if="activeTab==='layout'" label-width="80px" size="small" label-position="top">
|
||||
<!-- 排版设置内容保持不变 -->
|
||||
<el-form-item label="每行数量">
|
||||
<el-input-number :controls=false controls-position="right" v-model="perRow" size="mini" :min="1" :max="10" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二维码尺寸">
|
||||
<el-input-number :controls=false controls-position="right" v-model="barcodeWidth" size="mini" :min="60" :max="600" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纸张尺寸">
|
||||
<el-select v-model="paperSize" placeholder="请选择纸张尺寸" style="width: 160px">
|
||||
<el-option label="A4 (210mm x 297mm)" value="A4" />
|
||||
<el-option label="A5 (148mm x 210mm)" value="A5" />
|
||||
<el-option label="A6 (105mm x 148mm)" value="A6" />
|
||||
<el-option label="自定义" value="custom" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="paperSize==='custom'" label="自定义宽度(mm)">
|
||||
<el-input-number :controls=false controls-position="right" v-model="customPaperWidth" size="mini" :min="50" :max="500" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="paperSize==='custom'" label="自定义高度(mm)">
|
||||
<el-input-number :controls=false controls-position="right" v-model="customPaperHeight" size="mini" :min="50" :max="500" />
|
||||
</el-form-item>
|
||||
<el-form-item label="方向">
|
||||
<el-radio-group v-model="paperOrientation">
|
||||
<el-radio label="portrait">纵向</el-radio>
|
||||
<el-radio label="landscape">横向</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handlePrint">打印</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form v-else label-width="80px" size="small" label-position="top">
|
||||
<el-form-item label="二维码明细">
|
||||
<div v-for="(cfg, idx) in barcodeConfigs" :key="idx" style="margin-bottom: 16px; border: 1px solid #eee; border-radius: 4px; padding: 12px 16px; background: #fafbfc;">
|
||||
<div style="margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-weight: bold; color: #666;">条码 {{ idx + 1 }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="saveAsImage(cfg.code, cfg.textTpl || cfg.code, idx)"
|
||||
icon="el-icon-download"
|
||||
>
|
||||
另存为图片
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="handleDelete(cfg, idx)"
|
||||
icon="el-icon-delete"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-form-item label="二维码内容" label-width="70px" style="margin-bottom: 8px;">
|
||||
<el-input disabled type="textarea" v-model="cfg.code" size="mini" :autosize="{ minRows: 1, maxRows: 3 }" placeholder="请输入条码内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生成数量" label-width="70px" style="margin-bottom: 8px;">
|
||||
<el-input-number :controls=false controls-position="right" v-model.number="cfg.count" :min="1" :max="100" size="mini" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下方文字" label-width="70px" style="margin-bottom: 0;">
|
||||
<el-input type="textarea" v-model="cfg.textTpl" size="mini" placeholder="如 箱号" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QRCode from 'qrcode';
|
||||
export default {
|
||||
name: 'BarcodeGenerator',
|
||||
props: {
|
||||
barcodes: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
perRow: 3,
|
||||
barcodeWidth: 180,
|
||||
barcodeHeight: 180, // 二维码建议宽高一致
|
||||
barcodeConfigs: [], // [{code, count, textTpl}]
|
||||
previewScale: 1, // 预览缩放比例
|
||||
activeTab: 'layout',
|
||||
paperSize: 'A4',
|
||||
paperOrientation: 'portrait',
|
||||
customPaperWidth: 210,
|
||||
customPaperHeight: 297
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
expandedBarcodes() {
|
||||
let arr = [];
|
||||
this.barcodeConfigs.forEach(cfg => {
|
||||
for (let i = 0; i < (cfg.count || 1); i++) {
|
||||
arr.push(cfg.code);
|
||||
}
|
||||
});
|
||||
return arr;
|
||||
},
|
||||
expandedBarcodeTexts() {
|
||||
let arr = [];
|
||||
this.barcodeConfigs.forEach(cfg => {
|
||||
for (let i = 0; i < (cfg.count || 1); i++) {
|
||||
// 模板替换 {{n}}
|
||||
let text = cfg.textTpl || cfg.code;
|
||||
text = text.replace(/\{\{n\}\}/g, i + 1);
|
||||
arr.push(text);
|
||||
}
|
||||
});
|
||||
return arr;
|
||||
},
|
||||
expandedBarcodeTableData() {
|
||||
return this.expandedBarcodes.map((code, idx) => ({ code, text: this.expandedBarcodeTexts[idx] }));
|
||||
},
|
||||
barcodeRows() {
|
||||
const rows = [];
|
||||
const arr = this.expandedBarcodes;
|
||||
for (let i = 0; i < arr.length; i += this.perRow) {
|
||||
rows.push(arr.slice(i, i + this.perRow));
|
||||
}
|
||||
return rows;
|
||||
},
|
||||
barcodeTextRows() {
|
||||
const rows = [];
|
||||
const arr = this.expandedBarcodeTexts;
|
||||
for (let i = 0; i < arr.length; i += this.perRow) {
|
||||
rows.push(arr.slice(i, i + this.perRow));
|
||||
}
|
||||
return rows;
|
||||
},
|
||||
iframeStyle() {
|
||||
const { width, height } = this.getPaperPx();
|
||||
return {
|
||||
width: width + 'px',
|
||||
minHeight: height + 'px',
|
||||
height: height + 'px',
|
||||
background: '#fff',
|
||||
border: 'none',
|
||||
display: 'block',
|
||||
margin: 0,
|
||||
padding: 0
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
barcodes: {
|
||||
handler(newVal) {
|
||||
// 初始化barcodeConfigs
|
||||
this.barcodeConfigs = newVal;
|
||||
this.$nextTick(this.renderPreviewIframe);
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
barcodeConfigs: {
|
||||
handler() { this.$nextTick(this.renderPreviewIframe); },
|
||||
deep: true
|
||||
},
|
||||
perRow() { this.$nextTick(this.renderPreviewIframe); },
|
||||
barcodeWidth() { this.$nextTick(this.renderPreviewIframe); },
|
||||
barcodeHeight() { this.$nextTick(this.renderPreviewIframe); },
|
||||
previewScale() { this.$nextTick(this.renderPreviewIframe); },
|
||||
paperSize() { this.$nextTick(this.renderPreviewIframe); },
|
||||
paperOrientation() { this.$nextTick(this.renderPreviewIframe); },
|
||||
customPaperWidth() { this.$nextTick(this.renderPreviewIframe); },
|
||||
customPaperHeight() { this.$nextTick(this.renderPreviewIframe); }
|
||||
},
|
||||
methods: {
|
||||
getBarcodeId(row, col) {
|
||||
return `barcode-canvas-${row}-${col}`;
|
||||
},
|
||||
getBarcodeText(row, col, code) {
|
||||
if (
|
||||
this.barcodeTextRows[row] &&
|
||||
typeof this.barcodeTextRows[row][col] !== 'undefined' &&
|
||||
this.barcodeTextRows[row][col] !== null &&
|
||||
this.barcodeTextRows[row][col] !== ''
|
||||
) {
|
||||
return this.barcodeTextRows[row][col];
|
||||
}
|
||||
return code;
|
||||
},
|
||||
handleDelete(cfg, idx) {
|
||||
// this.barcodeConfigs.splice(idx, 1);
|
||||
this.$emit('delete', cfg, idx);
|
||||
},
|
||||
getPaperPx() {
|
||||
// mm to px, 1mm ≈ 3.78px
|
||||
let width, height;
|
||||
if (this.paperSize === 'A4') {
|
||||
width = 210 * 3.78;
|
||||
height = 297 * 3.78;
|
||||
} else if (this.paperSize === 'A5') {
|
||||
width = 148 * 3.78;
|
||||
height = 210 * 3.78;
|
||||
} else if (this.paperSize === 'A6') {
|
||||
width = 105 * 3.78;
|
||||
height = 148 * 3.78;
|
||||
} else {
|
||||
width = this.customPaperWidth * 3.78;
|
||||
height = this.customPaperHeight * 3.78;
|
||||
}
|
||||
if (this.paperOrientation === 'landscape') {
|
||||
return { width: height, height: width };
|
||||
}
|
||||
return { width, height };
|
||||
},
|
||||
getPrintHtml() {
|
||||
const { width, height } = this.getPaperPx();
|
||||
let html = `
|
||||
<html>
|
||||
<head>
|
||||
<title>打印二维码</title>
|
||||
<style>
|
||||
body { margin: 0; padding: 0; background: #fff; }
|
||||
.barcode-list { width: ${width}px; min-height: ${height}px; margin: 0 auto; background: #fff; }
|
||||
.barcode-row { display: flex; margin-bottom: 24px; }
|
||||
.barcode-item { flex: 1; text-align: center; }
|
||||
.barcode-text { margin-top: 8px; font-size: 14px; }
|
||||
html, body { overflow-x: hidden; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="barcode-list">
|
||||
`;
|
||||
this.barcodeRows.forEach((row, rowIndex) => {
|
||||
html += '<div class="barcode-row">';
|
||||
row.forEach((code, colIndex) => {
|
||||
const id = this.getBarcodeId(rowIndex, colIndex);
|
||||
const text = this.getBarcodeText(rowIndex, colIndex, code);
|
||||
html += `<div class="barcode-item">
|
||||
<canvas id="${id}" width="${this.barcodeWidth}" height="${this.barcodeHeight}"></canvas>
|
||||
<div class="barcode-text">${text}</div>
|
||||
</div>`;
|
||||
});
|
||||
html += '</div>';
|
||||
});
|
||||
html += '</div></body></html>';
|
||||
return html;
|
||||
},
|
||||
async renderPreviewIframe() {
|
||||
const iframe = this.$refs.previewIframe;
|
||||
if (!iframe) return;
|
||||
const doc = iframe.contentDocument || iframe.contentWindow.document;
|
||||
doc.open();
|
||||
doc.write(this.getPrintHtml());
|
||||
doc.close();
|
||||
// 渲染二维码
|
||||
setTimeout(async () => {
|
||||
for (let rowIndex = 0; rowIndex < this.barcodeRows.length; rowIndex++) {
|
||||
const row = this.barcodeRows[rowIndex];
|
||||
for (let colIndex = 0; colIndex < row.length; colIndex++) {
|
||||
const code = row[colIndex];
|
||||
const id = this.getBarcodeId(rowIndex, colIndex);
|
||||
const el = doc.getElementById(id);
|
||||
if (el) {
|
||||
await QRCode.toCanvas(el, code, {
|
||||
width: this.barcodeWidth,
|
||||
height: this.barcodeHeight,
|
||||
margin: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 50);
|
||||
},
|
||||
handlePrint() {
|
||||
const iframe = this.$refs.previewIframe;
|
||||
if (!iframe) return;
|
||||
iframe.contentWindow.focus();
|
||||
iframe.contentWindow.print();
|
||||
},
|
||||
/**
|
||||
* 保存二维码为图片
|
||||
* @param {string} code 二维码内容
|
||||
* @param {string} text 下方文字
|
||||
* @param {number} index 索引,用于生成文件名
|
||||
*/
|
||||
async saveAsImage(code, text, index) {
|
||||
try {
|
||||
// 创建临时canvas用于绘制二维码和文字
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// 计算总高度(二维码高度 + 文字区域高度)
|
||||
const textHeight = 30; // 文字区域高度
|
||||
canvas.width = this.barcodeWidth;
|
||||
canvas.height = this.barcodeHeight + textHeight;
|
||||
|
||||
// 绘制二维码
|
||||
const qrCanvas = document.createElement('canvas');
|
||||
qrCanvas.width = this.barcodeWidth;
|
||||
qrCanvas.height = this.barcodeHeight;
|
||||
await QRCode.toCanvas(qrCanvas, code, {
|
||||
width: this.barcodeWidth,
|
||||
height: this.barcodeHeight,
|
||||
margin: 0
|
||||
});
|
||||
|
||||
// 将二维码绘制到主canvas
|
||||
ctx.drawImage(qrCanvas, 0, 0);
|
||||
|
||||
// 绘制文字
|
||||
ctx.fillStyle = '#000';
|
||||
ctx.font = '14px Arial';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.fillText(text, this.barcodeWidth / 2, this.barcodeHeight + 5);
|
||||
|
||||
// 创建图片链接并下载
|
||||
canvas.toBlob(blob => {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
// 生成文件名(使用索引和内容摘要)
|
||||
const fileName = `二维码_${index + 1}_${code.substring(0, 10)}.png`;
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
});
|
||||
|
||||
this.$message.success('图片保存成功');
|
||||
} catch (error) {
|
||||
console.error('保存图片失败:', error);
|
||||
this.$message.error('保存图片失败,请重试');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.barcodeConfigs = this.barcodes?.map(b => ({ code: b, count: 1, textTpl: b })) || [];
|
||||
this.renderPreviewIframe();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 样式保持不变 */
|
||||
.barcode-3col-layout {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
min-height: 400px;
|
||||
}
|
||||
.barcode-preview-col {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
background: #fff;
|
||||
border-right: 1px solid #eee;
|
||||
padding: 24px 0 24px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 90vh;
|
||||
overflow: auto;
|
||||
}
|
||||
.barcode-right-col {
|
||||
width: 420px;
|
||||
min-width: 320px;
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fafbfc;
|
||||
height: 90vh;
|
||||
}
|
||||
.barcode-control-bar {
|
||||
border-bottom: 1px solid #eee;
|
||||
background: #fafbfc;
|
||||
padding: 0 16px;
|
||||
}
|
||||
.barcode-settings-panel {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
min-height: 0;
|
||||
max-height: calc(90vh - 48px); /* 48px 约为tabs高度,可根据实际调整 */
|
||||
}
|
||||
.preview-toolbar {
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.iframe-wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
background: #f8f8f8;
|
||||
overflow: auto;
|
||||
}
|
||||
.barcode-iframe {
|
||||
/* width、height 由:style绑定动态控制 */
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
border: none;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -1,606 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<template v-if="stockIo && stockIo.stockIoId">
|
||||
<!-- 主表信息 -->
|
||||
<el-descriptions :title="'单号:' + (stockIo.stockIoCode || '-')" :column="2" border>
|
||||
<el-descriptions-item label="类型">
|
||||
<dict-tag :options="dict.type.stock_io_type" :value="stockIo.ioType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="业务类型">
|
||||
<dict-tag :options="dict.type.stock_biz_type" :value="stockIo.bizType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag :type="stockIo.status === 2 ? 'success' : (stockIo.status === 1 ? 'warning' : 'info')">
|
||||
{{ stockIo.status === 2 ? '已完成' : (stockIo.status === 0 ? '草稿' : '待审核') }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ stockIo.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<!-- 明细表格 -->
|
||||
<el-tabs v-model="activeTab" style="margin-bottom: 10px;">
|
||||
<el-tab-pane label="扫码枪" name="scanner">
|
||||
<KLPTable :data="scannerList" :show-header="true" :border="true" style="width: 100%;" :default-sort="{}" :highlight-current-row="true">
|
||||
<el-table-column type="index" width="55" align="center" label="#" />
|
||||
<el-table-column label="库区/库位" align="center" prop="warehouseName" />
|
||||
<el-table-column v-if="stockIo.ioType === 'transfer'" label="源库区/库位" align="center" prop="fromWarehouseName" />
|
||||
<el-table-column label="物品类型" align="center" prop="itemType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物品信息" align="center" prop="itemId">
|
||||
<template slot-scope="scope">
|
||||
<raw-material-info v-if="scope.row.itemType === ITEM_TYPE.RAW_MATERIAL" :material-id="scope.row.itemId" />
|
||||
<product-info v-else-if="scope.row.itemType === ITEM_TYPE.PRODUCT" :product-id="scope.row.itemId" />
|
||||
<span v-else>{{ scope.row.itemId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
:disabled="stockIo.status >= 2"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
:disabled="stockIo.status >= 2"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="手动录入" name="manual">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
:disabled="stockIo.status >= 2"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single || stockIo.status >= 2"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple || stockIo.status >= 2"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<KLPTable v-loading="loading" :data="manualList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="库区/库位" align="center" prop="warehouseName" />
|
||||
<el-table-column
|
||||
v-if="stockIo.ioType === 'transfer'"
|
||||
label="源库区/库位"
|
||||
align="center"
|
||||
prop="fromWarehouseName"
|
||||
/>
|
||||
<el-table-column label="物品类型" align="center" prop="itemType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物品信息" align="center" prop="itemId">
|
||||
<template slot-scope="scope">
|
||||
<raw-material-info v-if="scope.row.itemType === ITEM_TYPE.RAW_MATERIAL" :material-id="scope.row.itemId" />
|
||||
<product-info v-else-if="scope.row.itemType === ITEM_TYPE.PRODUCT" :product-id="scope.row.itemId" />
|
||||
<span v-else>{{ scope.row.itemId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<BomInfoMini :item-type="scope.row.itemType" :item-id="scope.row.itemId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
:disabled="stockIo.status >= 2"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
:disabled="stockIo.status >= 2"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 操作按钮 -->
|
||||
<div style="margin-top: 20px; text-align: right;">
|
||||
<!-- 状态修改按钮 -->
|
||||
<el-button
|
||||
v-if="stockIo.status === 0"
|
||||
type="warning"
|
||||
:loading="statusLoading"
|
||||
@click="handleUpdateStatus"
|
||||
>{{ getStatusButtonText() }}</el-button>
|
||||
|
||||
<!-- 审核按钮 -->
|
||||
<el-button
|
||||
v-if="stockIo.status === 1"
|
||||
type="primary"
|
||||
:loading="auditLoading"
|
||||
@click="handleAudit"
|
||||
>{{ getAuditButtonText() }}</el-button>
|
||||
|
||||
<!-- 撤回按钮 -->
|
||||
<el-button
|
||||
v-if="stockIo.status === 2 && stockIo.ioType !== 'withdraw'"
|
||||
type="warning"
|
||||
:loading="cancelLoading"
|
||||
@click="handleCancel"
|
||||
>撤回</el-button>
|
||||
</div>
|
||||
<!-- 明细编辑弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="出入库单ID" prop="stockIoId">
|
||||
<el-input v-model="form.stockIoId" placeholder="请输入出入库单ID" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库区/库位" prop="warehouseId">
|
||||
<warehouse-select v-model="form.warehouseId" placeholder="请选择库区/库位" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="stockIo.ioType === 'transfer'"
|
||||
label="源库区/库位"
|
||||
prop="fromWarehouseId"
|
||||
>
|
||||
<warehouse-select v-model="form.fromWarehouseId" placeholder="请选择源库区/库位" />
|
||||
</el-form-item>
|
||||
<MaterialSelect :itemType.sync="form.itemType" :itemId.sync="form.itemId" @change="onItemChange" />
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" :disabled="unitDisabled" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="批次号" prop="batchNo">
|
||||
<el-input v-model="form.batchNo" placeholder="请输入批次号" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div style="height:200px;text-align:center;line-height:200px;">未获取到主表数据</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockIoDetail, getStockIoDetail, delStockIoDetail, addStockIoDetail, updateStockIoDetail } from "@/api/wms/stockIoDetail";
|
||||
import { auditStockIo, updateStockIoStatus, cancelStockIo, getStockIo, returnStock } from "@/api/wms/stockIo";
|
||||
import WarehouseSelect from '@/components/WarehouseSelect';
|
||||
import RawMaterialSelect from '@/components/KLPService/RawMaterialSelect';
|
||||
import ProductSelect from '@/components/KLPService/ProductSelect';
|
||||
import SemiSelect from '@/components/KLPService/SemiSelect';
|
||||
import { ITEM_TYPE } from '@/utils/enums';
|
||||
import {RawMaterialInfo, ProductInfo} from "@/components/KLPService";
|
||||
import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
||||
import MaterialSelect from '@/components/KLPService/MaterialSelect/index.vue';
|
||||
|
||||
export default {
|
||||
name: "StockIoDetailPanel",
|
||||
components: {
|
||||
WarehouseSelect,
|
||||
RawMaterialSelect,
|
||||
ProductSelect,
|
||||
RawMaterialInfo,
|
||||
ProductInfo,
|
||||
BomInfoMini,
|
||||
SemiSelect,
|
||||
MaterialSelect
|
||||
},
|
||||
dicts: ['stock_item_type', 'stock_biz_type', 'stock_io_type'],
|
||||
props: {
|
||||
stockIo: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ITEM_TYPE,
|
||||
loading: true,
|
||||
stockIoDetailList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
stockIoId: undefined
|
||||
},
|
||||
auditLoading: false,
|
||||
open: false,
|
||||
title: '',
|
||||
form: {},
|
||||
buttonLoading: false,
|
||||
rules: {
|
||||
warehouseId: [
|
||||
{ required: true, message: "库区/库位不能为空", trigger: "blur" }
|
||||
],
|
||||
itemType: [
|
||||
{ required: true, message: "物品类型不能为空", trigger: "blur" }
|
||||
],
|
||||
itemId: [
|
||||
{ required: true, message: "物品ID不能为空", trigger: "blur" }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: "数量不能为空", trigger: "blur" }
|
||||
],
|
||||
// unit: [
|
||||
// { required: true, message: "单位不能为空", trigger: "blur" }
|
||||
// ]
|
||||
},
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
statusLoading: false, // 新增状态修改按钮加载状态
|
||||
cancelLoading: false, // 撤回按钮加载状态
|
||||
unitDisabled: false, // 新增:单位输入框是否禁用
|
||||
activeTab: 'scanner' // 新增:当前激活的标签页
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'stockIo.stockIoId': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.queryParams.stockIoId = val;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 手动录入的列表,使用recordType区分为0
|
||||
manualList() {
|
||||
return this.stockIoDetailList.filter(item => item.recordType === 0);
|
||||
},
|
||||
// 来自扫码枪的列表,为1
|
||||
scannerList() {
|
||||
return this.stockIoDetailList.filter(item => item.recordType === 1);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.stockIo && this.stockIo.stockIoId) {
|
||||
this.queryParams.stockIoId = this.stockIo.stockIoId;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
if (!this.queryParams.stockIoId) return;
|
||||
this.loading = true;
|
||||
listStockIoDetail(this.queryParams).then(response => {
|
||||
this.stockIoDetailList = response.rows;
|
||||
this.total = response.total;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleAudit() {
|
||||
// 检查是否有明细数据
|
||||
if (!this.stockIoDetailList || this.stockIoDetailList.length === 0) {
|
||||
this.$modal.msgError('请先添加明细数据');
|
||||
return;
|
||||
}
|
||||
|
||||
// 确认审核
|
||||
this.$modal.confirm('确认要审核此出入库单吗?审核后将影响库存数据。').then(() => {
|
||||
this.auditLoading = true;
|
||||
// 如果是退库单,则需要先审核出库单
|
||||
if (this.stockIo.ioType === 'withdraw') {
|
||||
returnStock(this.stockIo).then(response => {
|
||||
this.$modal.msgSuccess('审核成功');
|
||||
this.$set(this.stockIo, 'status', 2);
|
||||
// 刷新明细列表
|
||||
this.getList();
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).finally(() => {
|
||||
this.auditLoading = false;
|
||||
})
|
||||
return;
|
||||
}
|
||||
auditStockIo(this.stockIo.stockIoId).then(response => {
|
||||
this.$modal.msgSuccess('审核成功');
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', 2);
|
||||
// 刷新明细列表
|
||||
this.getList();
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('审核失败:', error);
|
||||
this.$modal.msgError('审核失败:' + (error.message || '未知错误'));
|
||||
}).finally(() => {
|
||||
this.auditLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消审核
|
||||
});
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.detailId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.stockIoId = this.stockIo.stockIoId;
|
||||
this.form.recordType = 0; // 新增时设为手动录入
|
||||
this.open = true;
|
||||
this.title = "添加出入库单明细";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const detailId = row.detailId || this.ids
|
||||
getStockIoDetail(detailId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.form.recordType = 0; // 修改时强制设为手动录入
|
||||
this.open = true;
|
||||
this.title = "修改出入库单明细";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
// 动态添加源库位验证规则
|
||||
if (this.stockIo.ioType === 'transfer') {
|
||||
this.$set(this.rules, 'fromWarehouseId', [
|
||||
{ required: true, message: "源库区/库位不能为空", trigger: "blur" }
|
||||
]);
|
||||
} else {
|
||||
this.$delete(this.rules, 'fromWarehouseId');
|
||||
}
|
||||
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.detailId != null) {
|
||||
updateStockIoDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addStockIoDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
// 新增明细后刷新主表状态
|
||||
this.refreshStockIoStatus();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const detailIds = row.detailId || this.ids;
|
||||
this.$modal.confirm('是否确认删除出入库单明细编号为"' + detailIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delStockIoDetail(detailIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
// 删除明细后刷新主表状态
|
||||
this.refreshStockIoStatus();
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
detailId: undefined,
|
||||
stockIoId: undefined,
|
||||
warehouseId: undefined,
|
||||
fromWarehouseId: undefined,
|
||||
itemType: undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
// unit: undefined,
|
||||
batchNo: 'auto',
|
||||
remark: undefined
|
||||
};
|
||||
this.unitDisabled = false; // 新增:重置单位输入框为可编辑
|
||||
this.resetForm("form");
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
handleExport() {
|
||||
this.download('wms/stockIoDetail/export', {
|
||||
...this.queryParams
|
||||
}, `stockIoDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
getAuditButtonText() {
|
||||
if (this.stockIo.ioType === 'in') {
|
||||
return '审核入库';
|
||||
} else if (this.stockIo.ioType === 'out') {
|
||||
return '审核出库';
|
||||
} else if (this.stockIo.ioType === 'transfer') {
|
||||
return '审核移库';
|
||||
} else {
|
||||
return '审核';
|
||||
}
|
||||
},
|
||||
getStatusButtonText() {
|
||||
if (this.stockIo.ioType === 'in') {
|
||||
return '提交入库';
|
||||
} else if (this.stockIo.ioType === 'out') {
|
||||
return '提交出库';
|
||||
} else if (this.stockIo.ioType === 'transfer') {
|
||||
return '提交移库';
|
||||
} else {
|
||||
return '提交';
|
||||
}
|
||||
},
|
||||
handleUpdateStatus() {
|
||||
// 检查是否有明细数据
|
||||
if (!this.stockIoDetailList || this.stockIoDetailList.length === 0) {
|
||||
this.$modal.msgError('请先添加明细数据');
|
||||
return;
|
||||
}
|
||||
|
||||
this.$modal.confirm('确认要提交此出入库单吗?提交后将无法修改明细。').then(() => {
|
||||
this.statusLoading = true;
|
||||
updateStockIoStatus(this.stockIo.stockIoId, 1).then(response => {
|
||||
this.$modal.msgSuccess('状态更新成功');
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', 1);
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('状态更新失败:', error);
|
||||
this.$modal.msgError('状态更新失败:' + (error.message || '未知错误'));
|
||||
}).finally(() => {
|
||||
this.statusLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消状态更新
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.$modal.confirm('确认要撤回此出入库单吗?撤回后将回滚库存数据。').then(() => {
|
||||
this.cancelLoading = true;
|
||||
cancelStockIo(this.stockIo.stockIoId).then(response => {
|
||||
this.$modal.msgSuccess('撤回成功');
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', 1);
|
||||
// 刷新明细列表
|
||||
this.getList();
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('撤回失败:', error);
|
||||
this.$modal.msgError('撤回失败:' + (error.message || '未知错误'));
|
||||
}).finally(() => {
|
||||
this.cancelLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消撤回
|
||||
});
|
||||
},
|
||||
refreshStockIoStatus() {
|
||||
// 刷新主表状态
|
||||
if (this.stockIo && this.stockIo.stockIoId) {
|
||||
getStockIo(this.stockIo.stockIoId).then(response => {
|
||||
const updatedStockIo = response.data;
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', updatedStockIo.status);
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('刷新主表状态失败:', error);
|
||||
});
|
||||
}
|
||||
},
|
||||
getIoTypeTagType(type) {
|
||||
if (type === 'in') return 'success';
|
||||
if (type === 'out') return 'primary';
|
||||
if (type === 'transfer') return 'warning';
|
||||
return '';
|
||||
},
|
||||
getIoTypeLabel(type) {
|
||||
if (type === 'in') return '入库';
|
||||
if (type === 'out') return '出库';
|
||||
if (type === 'transfer') return '移库';
|
||||
return type;
|
||||
},
|
||||
getBizTypeLabel(type) {
|
||||
const map = {
|
||||
purchase: '采购',
|
||||
sales: '销售',
|
||||
return: '退货',
|
||||
relocation: '调拨',
|
||||
other: '其他'
|
||||
};
|
||||
return map[type] || type;
|
||||
},
|
||||
getBizTypeTagType(type) {
|
||||
if (type === 'purchase') return 'success';
|
||||
if (type === 'sales') return 'primary';
|
||||
if (type === 'return') return 'warning';
|
||||
if (type === 'relocation') return 'info';
|
||||
return 'default';
|
||||
},
|
||||
// onItemChange(e) {
|
||||
// if (e && e.unit) {
|
||||
// this.form.unit = e.unit;
|
||||
// this.unitDisabled = true;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,436 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<template v-if="stockIo && stockIo.stockIoId">
|
||||
<el-row>
|
||||
<el-form :model="returnForm" :rules="rules" inline label-width="120px">
|
||||
<el-form-item label="出库单单号">
|
||||
<el-input :value="stockIo.stockIoCode" disabled placeholder="请输入父单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出库单ID" prop="parentId">
|
||||
<el-input v-model="returnForm.parentId" disabled placeholder="请输入父单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退库单号" prop="stockIoCode">
|
||||
<el-input v-model="returnForm.stockIoCode" placeholder="请输入出入库单号" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-select v-model="returnForm.bizType" placeholder="请选择业务类型">
|
||||
<el-option v-for="dict in dict.type.stock_biz_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="returnForm.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<KLPTable v-loading="loading" :data="manualList">
|
||||
<el-table-column label="库区/库位" align="center" prop="warehouseName" />
|
||||
<el-table-column v-if="stockIo.ioType === 'transfer'" label="源库区/库位" align="center" prop="fromWarehouseName" />
|
||||
<el-table-column label="物品类型" align="center" prop="itemType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物品信息" align="center" prop="itemId">
|
||||
<template slot-scope="scope">
|
||||
<raw-material-info v-if="scope.row.itemType === ITEM_TYPE.RAW_MATERIAL" :material-id="scope.row.itemId" />
|
||||
<product-info v-else-if="scope.row.itemType === ITEM_TYPE.PRODUCT" :product-id="scope.row.itemId" />
|
||||
<span v-else>{{ scope.row.itemId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<BomInfoMini :item-type="scope.row.itemType" :item-id="scope.row.itemId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column width="55" label="开关">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.switchInput" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="180" align="center" prop="quantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :controls=false controls-position="right" style="width: 160px;" v-model="scope.row.count" :max="scope.row.quantity"
|
||||
placeholder="请输入数量" @input="handleQuantityInput(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 操作按钮 -->
|
||||
<div style="margin-top: 20px; text-align: right;">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div style="height:200px;text-align:center;line-height:200px;">未获取到主表数据</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockIoDetail, getStockIoDetail, delStockIoDetail, addStockIoDetail, updateStockIoDetail } from "@/api/wms/stockIoDetail";
|
||||
import { auditStockIo, updateStockIoStatus, cancelStockIo, getStockIo, addStockIoWithDetail } from "@/api/wms/stockIo";
|
||||
import WarehouseSelect from '@/components/WarehouseSelect';
|
||||
import RawMaterialSelect from '@/components/KLPService/RawMaterialSelect';
|
||||
import ProductSelect from '@/components/KLPService/ProductSelect';
|
||||
import SemiSelect from '@/components/KLPService/SemiSelect';
|
||||
import { ITEM_TYPE } from '@/utils/enums';
|
||||
import { RawMaterialInfo, ProductInfo } from "@/components/KLPService";
|
||||
import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
||||
import MaterialSelect from '@/components/KLPService/MaterialSelect/index.vue';
|
||||
|
||||
export default {
|
||||
name: "returnCreatePanel",
|
||||
components: {
|
||||
WarehouseSelect,
|
||||
RawMaterialSelect,
|
||||
ProductSelect,
|
||||
RawMaterialInfo,
|
||||
ProductInfo,
|
||||
BomInfoMini,
|
||||
SemiSelect,
|
||||
MaterialSelect
|
||||
},
|
||||
dicts: ['stock_item_type', 'stock_biz_type'],
|
||||
props: {
|
||||
stockIo: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ITEM_TYPE,
|
||||
loading: true,
|
||||
stockIoDetailList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
stockIoId: undefined
|
||||
},
|
||||
returnForm: {
|
||||
|
||||
},
|
||||
auditLoading: false,
|
||||
open: false,
|
||||
title: '',
|
||||
form: {},
|
||||
buttonLoading: false,
|
||||
rules: {
|
||||
warehouseId: [
|
||||
{ required: true, message: "库区/库位不能为空", trigger: "blur" }
|
||||
],
|
||||
itemType: [
|
||||
{ required: true, message: "物品类型不能为空", trigger: "blur" }
|
||||
],
|
||||
itemId: [
|
||||
{ required: true, message: "物品ID不能为空", trigger: "blur" }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: "数量不能为空", trigger: "blur" }
|
||||
],
|
||||
unit: [
|
||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'stockIo.stockIoId': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.queryParams.stockIoId = val;
|
||||
this.returnForm.parentId = val;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
manualList() {
|
||||
return this.stockIoDetailList.filter(item => item.recordType === 0);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.stockIo && this.stockIo.stockIoId) {
|
||||
this.queryParams.stockIoId = this.stockIo.stockIoId;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
if (!this.queryParams.stockIoId) return;
|
||||
this.loading = true;
|
||||
listStockIoDetail(this.queryParams).then(response => {
|
||||
this.stockIoDetailList = response.rows.map(item => {
|
||||
return {
|
||||
...item,
|
||||
count: item.quantity,
|
||||
switchInput: true
|
||||
}
|
||||
});
|
||||
this.total = response.total;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleAudit() {
|
||||
// 检查是否有明细数据
|
||||
if (!this.stockIoDetailList || this.stockIoDetailList.length === 0) {
|
||||
this.$modal.msgError('请先添加明细数据');
|
||||
return;
|
||||
}
|
||||
|
||||
// 确认审核
|
||||
this.$modal.confirm('确认要审核此出入库单吗?审核后将影响库存数据。').then(() => {
|
||||
this.auditLoading = true;
|
||||
auditStockIo(this.stockIo.stockIoId).then(response => {
|
||||
this.$modal.msgSuccess('审核成功');
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', 2);
|
||||
// 刷新明细列表
|
||||
this.getList();
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('审核失败:', error);
|
||||
this.$modal.msgError('审核失败:' + (error.message || '未知错误'));
|
||||
}).finally(() => {
|
||||
this.auditLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消审核
|
||||
});
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.detailId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleQuantityInput(row) {
|
||||
row.count = Math.min(row.count, row.quantity);
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.stockIoId = this.stockIo.stockIoId;
|
||||
this.form.recordType = 0; // 新增时设为手动录入
|
||||
this.open = true;
|
||||
this.title = "添加出入库单明细";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const detailId = row.detailId || this.ids
|
||||
getStockIoDetail(detailId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.form.recordType = 0; // 修改时强制设为手动录入
|
||||
this.open = true;
|
||||
this.title = "修改出入库单明细";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
// 手动校验
|
||||
if (!this.returnForm.stockIoCode) {
|
||||
this.$modal.msgError("请输入退库单号");
|
||||
return;
|
||||
}
|
||||
if (!this.returnForm.bizType) {
|
||||
this.$modal.msgError("请选择业务类型");
|
||||
return;
|
||||
}
|
||||
if (!this.manualList.filter(el => el.switchInput).length) {
|
||||
this.$modal.msgError("请至少选择一个明细");
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
stockIoCode: this.returnForm.stockIoCode,
|
||||
bizType: this.returnForm.bizType,
|
||||
remark: this.returnForm.remark,
|
||||
ioType: 'withdraw',
|
||||
parentId: this.returnForm.parentId,
|
||||
details: this.manualList.filter(el => el.switchInput).map(el => {
|
||||
const { detailId, stockIoId, switchInput, ...rest } = el;
|
||||
return {
|
||||
...rest,
|
||||
quantity: el.count,
|
||||
recordType: 0
|
||||
}
|
||||
})
|
||||
};
|
||||
addStockIoWithDetail(payload).then(response => {
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.$emit('finish', this.stockIo);
|
||||
}).catch(error => {
|
||||
this.$modal.msgError("提交失败:" + (error.message || "未知错误"));
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const detailIds = row.detailId || this.ids;
|
||||
this.$modal.confirm('是否确认删除出入库单明细编号为"' + detailIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delStockIoDetail(detailIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
// 删除明细后刷新主表状态
|
||||
this.refreshStockIoStatus();
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
detailId: undefined,
|
||||
stockIoId: undefined,
|
||||
warehouseId: undefined,
|
||||
fromWarehouseId: undefined,
|
||||
itemType: undefined,
|
||||
itemId: undefined,
|
||||
quantity: undefined,
|
||||
unit: undefined,
|
||||
batchNo: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.unitDisabled = false; // 新增:重置单位输入框为可编辑
|
||||
this.resetForm("form");
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
handleExport() {
|
||||
this.download('wms/stockIoDetail/export', {
|
||||
...this.queryParams
|
||||
}, `stockIoDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
getAuditButtonText() {
|
||||
if (this.stockIo.ioType === 'in') {
|
||||
return '审核入库';
|
||||
} else if (this.stockIo.ioType === 'out') {
|
||||
return '审核出库';
|
||||
} else if (this.stockIo.ioType === 'transfer') {
|
||||
return '审核移库';
|
||||
} else {
|
||||
return '审核';
|
||||
}
|
||||
},
|
||||
getStatusButtonText() {
|
||||
if (this.stockIo.ioType === 'in') {
|
||||
return '提交入库';
|
||||
} else if (this.stockIo.ioType === 'out') {
|
||||
return '提交出库';
|
||||
} else if (this.stockIo.ioType === 'transfer') {
|
||||
return '提交移库';
|
||||
} else {
|
||||
return '提交';
|
||||
}
|
||||
},
|
||||
handleUpdateStatus() {
|
||||
// 检查是否有明细数据
|
||||
if (!this.stockIoDetailList || this.stockIoDetailList.length === 0) {
|
||||
this.$modal.msgError('请先添加明细数据');
|
||||
return;
|
||||
}
|
||||
|
||||
this.$modal.confirm('确认要提交此出入库单吗?提交后将无法修改明细。').then(() => {
|
||||
this.statusLoading = true;
|
||||
updateStockIoStatus(this.stockIo.stockIoId, 1).then(response => {
|
||||
this.$modal.msgSuccess('状态更新成功');
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', 1);
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('状态更新失败:', error);
|
||||
this.$modal.msgError('状态更新失败:' + (error.message || '未知错误'));
|
||||
}).finally(() => {
|
||||
this.statusLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消状态更新
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.$modal.confirm('确认要撤回此出入库单吗?撤回后将回滚库存数据。').then(() => {
|
||||
this.cancelLoading = true;
|
||||
cancelStockIo(this.stockIo.stockIoId).then(response => {
|
||||
this.$modal.msgSuccess('撤回成功');
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', 1);
|
||||
// 刷新明细列表
|
||||
this.getList();
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('撤回失败:', error);
|
||||
this.$modal.msgError('撤回失败:' + (error.message || '未知错误'));
|
||||
}).finally(() => {
|
||||
this.cancelLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消撤回
|
||||
});
|
||||
},
|
||||
refreshStockIoStatus() {
|
||||
// 刷新主表状态
|
||||
if (this.stockIo && this.stockIo.stockIoId) {
|
||||
getStockIo(this.stockIo.stockIoId).then(response => {
|
||||
const updatedStockIo = response.data;
|
||||
// 更新主表状态
|
||||
this.$set(this.stockIo, 'status', updatedStockIo.status);
|
||||
// 通知父组件状态已更新
|
||||
this.$emit('status-changed', this.stockIo);
|
||||
}).catch(error => {
|
||||
console.error('刷新主表状态失败:', error);
|
||||
});
|
||||
}
|
||||
},
|
||||
getIoTypeTagType(type) {
|
||||
if (type === 'in') return 'success';
|
||||
if (type === 'out') return 'primary';
|
||||
if (type === 'transfer') return 'warning';
|
||||
return '';
|
||||
},
|
||||
getIoTypeLabel(type) {
|
||||
if (type === 'in') return '入库';
|
||||
if (type === 'out') return '出库';
|
||||
if (type === 'transfer') return '移库';
|
||||
return type;
|
||||
},
|
||||
getBizTypeLabel(type) {
|
||||
const map = {
|
||||
purchase: '采购',
|
||||
sales: '销售',
|
||||
return: '退货',
|
||||
relocation: '调拨',
|
||||
other: '其他'
|
||||
};
|
||||
return map[type] || type;
|
||||
},
|
||||
getBizTypeTagType(type) {
|
||||
if (type === 'purchase') return 'success';
|
||||
if (type === 'sales') return 'primary';
|
||||
if (type === 'return') return 'warning';
|
||||
if (type === 'relocation') return 'info';
|
||||
return 'default';
|
||||
},
|
||||
onItemChange(e) {
|
||||
if (e && e.unit) {
|
||||
this.form.unit = e.unit;
|
||||
this.unitDisabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,365 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="单号" prop="stockIoCode">
|
||||
<el-input v-model="queryParams.stockIoCode" placeholder="请输入出入库单号" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-select v-model="queryParams.bizType" placeholder="请选择业务类型" clearable>
|
||||
<el-option v-for="dict in dict.type.stock_biz_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择单据状态" clearable>
|
||||
<el-option :key="0" label="草稿" :value="0" />
|
||||
<el-option :key="1" label="待审核" :value="1" />
|
||||
<el-option :key="2" label="已完成" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="stockIoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="出入库单ID" align="center" prop="stockIoId" v-if="false" />
|
||||
<el-table-column label="出入库单号" align="center" prop="stockIoCode" />
|
||||
<el-table-column label="类型" align="center" prop="ioType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_io_type" :value="scope.row.ioType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务类型" align="center" prop="bizType">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-tag :type="getBizTypeTagType(scope.row.bizType)">
|
||||
{{ getBizTypeLabel(scope.row.bizType) }}
|
||||
</el-tag> -->
|
||||
<dict-tag :options="dict.type.stock_biz_type" :value="scope.row.bizType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 2 ? 'success' : (scope.row.status === 1 ? 'warning' : 'info')">
|
||||
{{ scope.row.status === 2 ? '已完成' : (scope.row.status === 0 ? '草稿' : '待审核') }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-document" @click="showDetail(scope.row)">明细</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-document"
|
||||
v-if="scope.row.ioType === 'out' && scope.row.status === 2"
|
||||
@click="showReturnCreate(scope.row)">退库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改出入库单主对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="出入库单号" prop="stockIoCode">
|
||||
<el-input v-model="form.stockIoCode" placeholder="请输入出入库单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-select v-model="form.bizType" placeholder="请选择业务类型">
|
||||
<el-option v-for="dict in dict.type.stock_biz_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-input v-model="form.status" :value="0" readonly disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 明细弹窗 -->
|
||||
<el-dialog title="单据明细" :visible.sync="detailDialogVisible" width="1000px" append-to-body @close="onDetailClosed">
|
||||
<StockIoDetailPanel :stockIo="detailStockIo" @status-changed="onStatusChanged" />
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="退库单" :visible.sync="returnCreateDialogVisible" width="1000px" append-to-body>
|
||||
<ReturnCreatePanel :stockIo="form" @finish="returnCreateDialogVisible = false" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockIo, getStockIo, delStockIo, addStockIo, updateStockIo } from "@/api/wms/stockIo";
|
||||
import StockIoDetailPanel from './detail.vue';
|
||||
import ReturnCreatePanel from './returnCreate.vue';
|
||||
|
||||
export default {
|
||||
name: "StockIo",
|
||||
dicts: ['stock_biz_type', 'stock_status', 'stock_io_type'],
|
||||
components: { StockIoDetailPanel, ReturnCreatePanel },
|
||||
props: {
|
||||
ioType: {
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 出入库单主表格数据
|
||||
stockIoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
stockIoCode: undefined,
|
||||
ioType: this.ioType,
|
||||
bizType: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockIoId: [
|
||||
{ required: true, message: "出入库单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
stockIoCode: [
|
||||
{ required: true, message: "出入库单号不能为空", trigger: "blur" }
|
||||
],
|
||||
bizType: [
|
||||
{ required: true, message: "业务类型不能为空", trigger: "change" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "单据状态不能为空", trigger: "change" }
|
||||
],
|
||||
delFlag: [
|
||||
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
detailDialogVisible: false,
|
||||
detailStockIo: null,
|
||||
returnCreateDialogVisible: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询出入库单主列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStockIo(this.queryParams).then(response => {
|
||||
this.stockIoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockIoId: undefined,
|
||||
stockIoCode: undefined,
|
||||
ioType: this.ioType,
|
||||
bizType: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stockIoId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.status = 0; // 新增时默认草稿状态
|
||||
this.open = true;
|
||||
this.title = "添加单据";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const stockIoId = row.stockIoId || this.ids
|
||||
getStockIo(stockIoId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改单据";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.stockIoId != null) {
|
||||
updateStockIo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addStockIo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockIoIds = row.stockIoId || this.ids;
|
||||
this.$modal.confirm('是否确认删除出入库单主编号为"' + stockIoIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delStockIo(stockIoIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/stockIo/export', {
|
||||
...this.queryParams
|
||||
}, `stockIo_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
showDetail(row) {
|
||||
this.detailStockIo = { ...row };
|
||||
this.detailDialogVisible = true;
|
||||
},
|
||||
onDetailClosed() {
|
||||
this.getList();
|
||||
},
|
||||
onStatusChanged(updatedStockIo) {
|
||||
// 更新主表中的对应记录状态
|
||||
const index = this.stockIoList.findIndex(item => item.stockIoId === updatedStockIo.stockIoId);
|
||||
if (index !== -1) {
|
||||
this.$set(this.stockIoList, index, updatedStockIo);
|
||||
}
|
||||
// 刷新列表
|
||||
this.getList();
|
||||
},
|
||||
getIoTypeTagType(type) {
|
||||
if (type === 'in') return 'success';
|
||||
if (type === 'out') return 'primary';
|
||||
if (type === 'transfer') return 'warning';
|
||||
return '';
|
||||
},
|
||||
getIoTypeLabel(type) {
|
||||
if (type === 'in') return '入库';
|
||||
if (type === 'out') return '出库';
|
||||
if (type === 'transfer') return '移库';
|
||||
return type;
|
||||
},
|
||||
getBizTypeTagType(type) {
|
||||
if (type === 'purchase') return 'success';
|
||||
if (type === 'sales') return 'primary';
|
||||
if (type === 'return') return 'warning';
|
||||
if (type === 'relocation') return 'info';
|
||||
return 'default';
|
||||
},
|
||||
getBizTypeLabel(type) {
|
||||
const map = {
|
||||
purchase: '采购',
|
||||
sales: '销售',
|
||||
return: '退货',
|
||||
relocation: '调拨',
|
||||
other: '其他'
|
||||
};
|
||||
return map[type] || type;
|
||||
},
|
||||
showReturnCreate(row) {
|
||||
this.returnCreateDialogVisible = true;
|
||||
this.form = { ...row };
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,13 +0,0 @@
|
||||
<template>
|
||||
<StockIoPage ioType="withdraw" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StockIoPage from './panels/stockIoPage.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
StockIoPage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -64,7 +64,7 @@
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.coil.itemType == 'product'" :product="scope.row.coil.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.coil.itemType === 'raw_material'"
|
||||
:material="scope.row.coil.rawMaterial" />
|
||||
:material="scope.row.coil" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouse.actualWarehouseName" label="库位" width="150">
|
||||
|
||||
Reference in New Issue
Block a user