|
|
|
|
@ -83,7 +83,7 @@
|
|
|
|
|
<div class="product-page-right">
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" :row-class-name="getRowClassName">
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.tableBarCodeColumn')" align="center" prop="barCode"
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.tableBarCodeColumn')" align="center" prop="barCode" width="180px"
|
|
|
|
|
sortable />
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.dialogCategoryTypeLabel')" align="center" prop="categoryType" sortable>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
@ -91,7 +91,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.tableNameColumn')" align="left" prop="name"
|
|
|
|
|
width="220px" sortable />
|
|
|
|
|
sortable />
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.tableStandardColumn')" align="center"
|
|
|
|
|
prop="standard" sortable />
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.tableCategoryColumn')" align="center"
|
|
|
|
|
@ -109,7 +109,7 @@
|
|
|
|
|
<el-table-column :label="t('FactoryModeling.ProductInformation.tableOperateColumn')" align="center" width="210px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button link type="primary" @click="handleShowDetail(scope.row.id)">
|
|
|
|
|
详情
|
|
|
|
|
{{ t('FactoryModeling.ProductInformation.tableDetailAction') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['erp:product:update']">
|
|
|
|
|
{{ t('FactoryModeling.ProductInformation.tableEditAction') }}
|
|
|
|
|
@ -127,7 +127,7 @@
|
|
|
|
|
<ContentWrap v-if="detailVisible" class="product-detail-wrap" v-loading="detailLoading">
|
|
|
|
|
<template v-if="productDetail">
|
|
|
|
|
<div class="detail-header">
|
|
|
|
|
<div class="detail-title">物料详情</div>
|
|
|
|
|
<div class="detail-title">{{ t('FactoryModeling.ProductInformation.detailTitle') }}</div>
|
|
|
|
|
<el-button text @click="closeDetail">
|
|
|
|
|
<Icon icon="ep:close" />
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -163,33 +163,33 @@
|
|
|
|
|
|
|
|
|
|
<div class="detail-info">
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogBarCodeLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogBarCodeLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.barCode) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogCategoryTypeLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogCategoryTypeLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatCategoryType(productDetail.categoryType) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogNameLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogNameLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.name) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogCategoryLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogCategoryLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.subCategoryName) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogUnitLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogUnitLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.unitName) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 物料/备件类型:供应商 -->
|
|
|
|
|
<template v-if="productDetail.categoryType === 2 || productDetail.categoryType === 3">
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogPurchaseUnitLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogPurchaseUnitLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.purchaseUnitName) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogPurchaseUnitConvertLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogPurchaseUnitConvertLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatPurchaseUnitConvert(productDetail) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="detail-field">
|
|
|
|
|
@ -198,49 +198,49 @@
|
|
|
|
|
</div> -->
|
|
|
|
|
</template>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogStandardLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogStandardLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.standard || productDetail.deviceSpec || productDetail.model) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogExpiryDayLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogExpiryDayLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.expiryDay) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogStatusLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogStatusLabel') }) }}</span>
|
|
|
|
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="productDetail.status" />
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 产品类型:关联设备、关联模具 -->
|
|
|
|
|
<template v-if="productDetail.categoryType === 1">
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">关联设备:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogDeviceLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatDeviceText(productDetail) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">关联模具:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogMoldLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatMoldText(productDetail) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- 备件类型:备件等级、是否易损件、采购周期、品牌 -->
|
|
|
|
|
<template v-if="productDetail.categoryType === 3">
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogSparePartLevelLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogSparePartLevelLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatSparePartLevel(productDetail.sparePartLevel) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogFragileFlagLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogFragileFlagLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ productDetail.fragileFlag === 1 ? t('common.yes') : productDetail.fragileFlag === 0 ? t('common.no') : '-' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogPurchaseCycleLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogPurchaseCycleLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.purchaseCycle) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-field">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogBrandLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogBrandLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.brand) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="detail-field detail-field--full">
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.dialogRemarkLabel') }}:</span>
|
|
|
|
|
<span class="field-label">{{ t('FactoryModeling.ProductInformation.detailLabelText', { label: t('FactoryModeling.ProductInformation.dialogRemarkLabel') }) }}</span>
|
|
|
|
|
<span class="field-value">{{ formatValue(productDetail.remark) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -251,22 +251,22 @@
|
|
|
|
|
<template v-if="productDetail.categoryType === 1">
|
|
|
|
|
<div class="summary-item">
|
|
|
|
|
<Icon icon="ep:box" class="summary-icon" />
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.dialogPackagingSchemeLabel') }}:{{ packagingSchemeCount }} 个</span>
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.detailCountText', { label: t('FactoryModeling.ProductInformation.dialogPackagingSchemeLabel'), count: packagingSchemeCount }) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="summary-item">
|
|
|
|
|
<Icon icon="ep:document-checked" class="summary-icon" />
|
|
|
|
|
<span>默认参考方案:{{ defaultPackagingSchemeText }}</span>
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.defaultPackagingSchemeText', { name: defaultPackagingSchemeText }) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- 物料/备件类型:供应商摘要 -->
|
|
|
|
|
<template v-if="productDetail.categoryType === 2 || productDetail.categoryType === 3">
|
|
|
|
|
<div class="summary-item">
|
|
|
|
|
<Icon icon="ep:office-building" class="summary-icon" />
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.dialogSupplierLabel') }}:{{ supplierCount }} 个</span>
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.detailCountText', { label: t('FactoryModeling.ProductInformation.dialogSupplierLabel'), count: supplierCount }) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="summary-item">
|
|
|
|
|
<Icon icon="ep:star" class="summary-icon" />
|
|
|
|
|
<span>默认供应商:{{ defaultSupplierText }}</span>
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.defaultSupplierText', { name: defaultSupplierText }) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -274,7 +274,7 @@
|
|
|
|
|
<div v-if="productDetail.categoryType === 1" class="detail-table-box">
|
|
|
|
|
<div class="detail-table-title">
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.dialogPackagingSchemeLabel') }}</span>
|
|
|
|
|
<span>共 {{ packagingSchemeCount }} 个</span>
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.totalCountText', { count: packagingSchemeCount }) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="productDetail.packagingSchemes || []" border size="small" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column :label="t('ErpStock.PackagingScheme.name')" prop="packagingSchemeName" min-width="130" />
|
|
|
|
|
@ -286,7 +286,7 @@
|
|
|
|
|
<div v-else-if="productDetail.categoryType === 2 || productDetail.categoryType === 3" class="detail-table-box">
|
|
|
|
|
<div class="detail-table-title">
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.dialogSupplierLabel') }}</span>
|
|
|
|
|
<span>共 {{ supplierCount }} 个</span>
|
|
|
|
|
<span>{{ t('FactoryModeling.ProductInformation.totalCountText', { count: supplierCount }) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="productDetail.suppliers || []" border size="small" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column :label="t('ErpPurchase.Supplier.name')" prop="supplierName" min-width="160">
|
|
|
|
|
@ -489,7 +489,7 @@ const handleExport = async () => {
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
const data = await ProductApi.exportProduct(queryParams)
|
|
|
|
|
download.excel(data, '产品.xls')
|
|
|
|
|
download.excel(data, t('FactoryModeling.ProductInformation.exportFilename'))
|
|
|
|
|
} catch {
|
|
|
|
|
} finally {
|
|
|
|
|
exportLoading.value = false
|
|
|
|
|
@ -565,7 +565,9 @@ const defaultPackagingSchemeText = computed(() => {
|
|
|
|
|
|
|
|
|
|
const detailSummaryTitle = computed(() => {
|
|
|
|
|
const categoryType = formatCategoryType(productDetail.value?.categoryType)
|
|
|
|
|
return categoryType === '-' ? '物料属性摘要' : `${categoryType}属性摘要`
|
|
|
|
|
return categoryType === '-'
|
|
|
|
|
? t('FactoryModeling.ProductInformation.materialSummaryTitle')
|
|
|
|
|
: t('FactoryModeling.ProductInformation.categorySummaryTitle', { category: categoryType })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 供应商相关计算
|
|
|
|
|
@ -584,16 +586,16 @@ const defaultSupplierText = computed(() => {
|
|
|
|
|
const formatDeviceText = (detail: any) => {
|
|
|
|
|
if (!detail?.devices?.length && !detail?.deviceList?.length) return '-'
|
|
|
|
|
const list = detail.devices || detail.deviceList || []
|
|
|
|
|
return list.map((item: any) => item.name || item.deviceName || `ID:${item.id}`).join('、') || '-'
|
|
|
|
|
return list.map((item: any) => item.name || item.deviceName || `ID:${item.id}`).join(t('FactoryModeling.ProductInformation.listSeparator')) || '-'
|
|
|
|
|
}
|
|
|
|
|
const formatMoldText = (detail: any) => {
|
|
|
|
|
if (!detail?.molds?.length && !detail?.moldList?.length) return '-'
|
|
|
|
|
const list = detail.molds || detail.moldList || []
|
|
|
|
|
return list.map((item: any) => item.name || item.code || `ID:${item.id}`).join('、') || '-'
|
|
|
|
|
return list.map((item: any) => item.name || item.code || `ID:${item.id}`).join(t('FactoryModeling.ProductInformation.listSeparator')) || '-'
|
|
|
|
|
}
|
|
|
|
|
const formatSupplierText = (detail: any) => {
|
|
|
|
|
if (!detail?.suppliers?.length) return '-'
|
|
|
|
|
return detail.suppliers.map((item: any) => item.supplierName || `ID:${item.supplierId}`).join('、') || '-'
|
|
|
|
|
return detail.suppliers.map((item: any) => item.supplierName || `ID:${item.supplierId}`).join(t('FactoryModeling.ProductInformation.listSeparator')) || '-'
|
|
|
|
|
}
|
|
|
|
|
const formatSparePartLevel = (value: any) => {
|
|
|
|
|
if (value === undefined || value === null || value === '') return '-'
|
|
|
|
|
|