refactor(wms): 重构物料信息展示逻辑,移除冗余组件
重构物料信息展示逻辑,统一使用itemName等字段替代原有的product和rawMaterial嵌套结构 删除不再使用的BomInfo、CategoryRenderer等冗余组件 新增report模块配置集中管理 优化代码结构,提升可维护性
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<el-option label="未入库钢卷" value="unIn" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||
<el-input v-model="materialQueryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable
|
||||
@keyup.enter.native="handleMaterialQuery" style="width: 150px;" />
|
||||
@@ -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>
|
||||
@@ -184,7 +151,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<i slot="reference" class="el-icon-setting param-icon"></i>
|
||||
</el-popover>
|
||||
|
||||
@@ -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,9 +1039,8 @@ 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 = {
|
||||
...row,
|
||||
@@ -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 '';
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user