实现国际化

main
liutao 20 hours ago
parent 7445685654
commit 08e9ecd611

@ -2750,6 +2750,7 @@ export default {
dialogBarCodePlaceholder: 'Please enter code',
dialogNameLabel: 'Name',
dialogNamePlaceholder: 'Please enter name',
dialogCategoryTypeLabel: 'Type',
dialogCategoryLabel: 'Category',
dialogCategoryPlaceholder: 'Please select category',
dialogUnitLabel: 'Inventory Unit',
@ -2802,7 +2803,43 @@ export default {
images: 'Image',
categoryTree: 'Material Category',
addCategory: 'Add Category',
refreshTree: 'Refresh'
refreshTree: 'Refresh',
tableDetailAction: 'Details',
detailTitle: 'Material Details',
detailLabelText: '{label}:',
listSeparator: ', ',
dialogDeviceLabel: 'Related Devices',
dialogMoldLabel: 'Related Molds',
detailCountText: '{label}: {count}',
defaultPackagingSchemeText: 'Default Reference Scheme: {name}',
defaultSupplierText: 'Default Supplier: {name}',
totalCountText: '{count} total',
exportFilename: 'Products.xls',
materialSummaryTitle: 'Material Attribute Summary',
categorySummaryTitle: '{category} Attribute Summary',
addUnitButton: '+ Add Unit',
unitNamePlaceholder: 'Please enter unit name',
dialogDevicePlaceholder: 'Click to select devices',
dialogMoldPlaceholder: 'Click to select molds',
qrcodePrintTitle: '{name} QR Code Print Preview',
defaultProductName: 'Product',
qrcodeRefreshConfirm: 'Refresh this product QR code?',
deviceSelectTitle: 'Select Devices',
deviceCodeLabel: 'Device Code',
codePlaceholder: 'Please enter code',
deviceNameLabel: 'Device Name',
namePlaceholder: 'Please enter name',
moldSelectTitle: 'Select Molds',
moldCodeLabel: 'Mold Code',
moldNameLabel: 'Mold Name',
defaultSupplierColumn: 'Default Supplier',
deviceModelLabel: 'Device Model',
workshopLabel: 'Workshop',
moldModelLabel: 'Mold Model',
deviceIdFallback: 'Device ID: {id}',
moldIdFallback: 'Mold ID: {id}',
unitNameRequired: 'Please enter unit name',
addUnitSuccess: 'Unit added successfully'
},
AutocodeRule: {
moduleName: 'Code Rules',
@ -3049,6 +3086,7 @@ export default {
dialogPrimaryUnitPlaceholder: 'Please select primary unit',
dialogChangeRateLabel: 'Conversion Rate',
dialogChangeRatePlaceholder: 'Please enter conversion rate',
dialogChangeRateTooltip: 'Conversion rate to the primary unit. For example: s = 1000 ms, so the conversion rate is 1000.',
dialogStatusLabel: 'Unit Status',
dialogCancelButton: 'Cancel',
dialogSubmitButton: 'Confirm',
@ -3066,7 +3104,9 @@ export default {
'Upload success: {createCount}; Update success: {updateCount}; Update failed: {failureCount};',
importFailed: 'Upload failed, please upload again!',
importFileLimit: 'Only one file can be uploaded!',
nameEnColumn:'English Unit Name'
nameEnColumn: 'English Unit Name',
exportFilename: 'ProductUnits.xls',
importTemplateFilename: 'UnitImportTemplate.xls'
},
CalHoliday: {
setWorkingDays: 'set working days',

@ -4101,7 +4101,43 @@ export default {
images: '图片',
categoryTree: '物料分类',
addCategory: '新增分类',
refreshTree: '刷新'
refreshTree: '刷新',
tableDetailAction: '详情',
detailTitle: '物料详情',
detailLabelText: '{label}',
listSeparator: '、',
dialogDeviceLabel: '关联设备',
dialogMoldLabel: '关联模具',
detailCountText: '{label}{count} 个',
defaultPackagingSchemeText: '默认参考方案:{name}',
defaultSupplierText: '默认供应商:{name}',
totalCountText: '共 {count} 个',
exportFilename: '产品.xls',
materialSummaryTitle: '物料属性摘要',
categorySummaryTitle: '{category}属性摘要',
addUnitButton: '+ 新增单位',
unitNamePlaceholder: '请输入单位名称',
dialogDevicePlaceholder: '点击选择设备',
dialogMoldPlaceholder: '点击选择模具',
qrcodePrintTitle: '{name}二维码打印预览',
defaultProductName: '产品',
qrcodeRefreshConfirm: '确认刷新该产品二维码吗?',
deviceSelectTitle: '选择设备',
deviceCodeLabel: '设备编号',
codePlaceholder: '请输入编号',
deviceNameLabel: '设备名称',
namePlaceholder: '请输入名称',
moldSelectTitle: '选择模具',
moldCodeLabel: '模具编号',
moldNameLabel: '模具名称',
defaultSupplierColumn: '是否默认供应商',
deviceModelLabel: '设备型号',
workshopLabel: '所属车间',
moldModelLabel: '模具型号',
deviceIdFallback: '设备ID:{id}',
moldIdFallback: '模具ID:{id}',
unitNameRequired: '请输入单位名称',
addUnitSuccess: '新增单位成功'
},
AutocodeRule: {
moduleName: '编码规则',
@ -4347,6 +4383,7 @@ export default {
dialogPrimaryUnitPlaceholder: '请选择主单位',
dialogChangeRateLabel: '换算比例',
dialogChangeRatePlaceholder: '请输入换算比例',
dialogChangeRateTooltip: '与主单位换算比例s = 1000 ms换算比例为1000',
dialogStatusLabel: '单位状态',
dialogCancelButton: '取 消',
dialogSubmitButton: '确 定',
@ -4365,7 +4402,9 @@ export default {
'上传成功数量:{createCount};更新成功数量:{updateCount};更新失败数量:{failureCount}',
importFailed: '上传失败,请您重新上传!',
importFileLimit: '最多只能上传一个文件!',
nameEnColumn:'单位英文名称'
nameEnColumn: '单位英文名称',
exportFilename: '产品单位.xls',
importTemplateFilename: '单位导入模版.xls'
},
//假日管理
CalHoliday: {

@ -57,14 +57,14 @@
<template #footer>
<div v-if="!isAddingUnit" class="px-10px py-6px">
<el-button text bg size="small" @click.stop="onAddUnit('unit')">
+ 新增单位
{{ t('FactoryModeling.ProductInformation.addUnitButton') }}
</el-button>
</div>
<div v-else class="px-10px py-6px">
<el-input v-model="unitInputName" size="small" placeholder="请输入单位名称" class="mb-6px" />
<el-input v-model="unitInputName" size="small" :placeholder="t('FactoryModeling.ProductInformation.unitNamePlaceholder')" class="mb-6px" />
<div class="flex gap-6px">
<el-button type="primary" size="small" @click.stop="onConfirmAddUnit('unit')">确定</el-button>
<el-button size="small" @click.stop="clearAddUnit()">取消</el-button>
<el-button type="primary" size="small" @click.stop="onConfirmAddUnit('unit')">{{ t('common.ok') }}</el-button>
<el-button size="small" @click.stop="clearAddUnit()">{{ t('common.cancel') }}</el-button>
</div>
</div>
</template>
@ -81,15 +81,15 @@
<template #footer>
<div v-if="!isAddingPurchaseUnit" class="px-10px py-6px">
<el-button text bg size="small" @click.stop="onAddUnit('purchaseUnit')">
+ 新增单位
{{ t('FactoryModeling.ProductInformation.addUnitButton') }}
</el-button>
</div>
<div v-else class="px-10px py-6px">
<el-input v-model="unitInputName" size="small" placeholder="请输入单位名称" class="mb-6px" />
<el-input v-model="unitInputName" size="small" :placeholder="t('FactoryModeling.ProductInformation.unitNamePlaceholder')" class="mb-6px" />
<div class="flex gap-6px">
<el-button type="primary" size="small"
@click.stop="onConfirmAddUnit('purchaseUnit')">确定</el-button>
<el-button size="small" @click.stop="clearAddUnit()">取消</el-button>
@click.stop="onConfirmAddUnit('purchaseUnit')">{{ t('common.ok') }}</el-button>
<el-button size="small" @click.stop="clearAddUnit()">{{ t('common.cancel') }}</el-button>
</div>
</div>
</template>
@ -117,14 +117,14 @@
</el-form-item>
</el-col>
<!-- <el-col v-if="isProductCategory" :span="12">
<el-form-item label="关联设备" prop="devices">
<el-input :model-value="deviceDisplayText" placeholder="点击选择设备" readonly
<el-form-item :label="t('FactoryModeling.ProductInformation.dialogDeviceLabel')" prop="devices">
<el-input :model-value="deviceDisplayText" :placeholder="t('FactoryModeling.ProductInformation.dialogDevicePlaceholder')" readonly
@click="openDeviceSelectDialog" />
</el-form-item>
</el-col>
<el-col v-if="isProductCategory" :span="12">
<el-form-item label="关联模具" prop="molds">
<el-input :model-value="moldDisplayText" placeholder="点击选择模具" readonly @click="openMoldSelectDialog" />
<el-form-item :label="t('FactoryModeling.ProductInformation.dialogMoldLabel')" prop="molds">
<el-input :model-value="moldDisplayText" :placeholder="t('FactoryModeling.ProductInformation.dialogMoldPlaceholder')" readonly @click="openMoldSelectDialog" />
</el-form-item>
</el-col> -->
<el-col v-if="formData.categoryType === 1" :span="12">
@ -187,9 +187,9 @@
<div class="flex items-start gap-20px">
<el-form-item :label="t('FactoryModeling.ProductInformation.qrcode')" prop="qrcodeUrl" class="flex-1">
<QrcodeActionCard :image-url="formData.qrcodeUrl" :print-id="formData.id" :print-template-type="1"
:print-title="`${formData.name || '产品'}二维码打印预览`"
:print-title="t('FactoryModeling.ProductInformation.qrcodePrintTitle', { name: formData.name || t('FactoryModeling.ProductInformation.defaultProductName') })"
:empty-text="t('FactoryModeling.ProductInformation.qrcodeEmpty')" :refresh-url="getQrcodeRefreshUrl()"
:refresh-disabled="!formData.id || !formData.barCode" refresh-confirm-text="确认刷新该产品二维码吗?"
:refresh-disabled="!formData.id || !formData.barCode" :refresh-confirm-text="t('FactoryModeling.ProductInformation.qrcodeRefreshConfirm')"
:template-json="formData.templateJson" :print-data="buildPrintData()"
@refresh-success="handleQrcodeRefreshSuccess" />
</el-form-item>
@ -222,16 +222,16 @@
</el-button>
</div>
</div>
<TableSelectDialog ref="deviceSelectDialogRef" title="选择设备" :columns="deviceColumns"
<TableSelectDialog ref="deviceSelectDialogRef" :title="t('FactoryModeling.ProductInformation.deviceSelectTitle')" :columns="deviceColumns"
:fetch-api="fetchDeviceLedgerPage" row-key="id" @confirm="handleDeviceSelectConfirm"
:query-params="mergedQueryParams">
<template #header>
<el-form ref="searchFormRef" :model="searchParams" :inline="true">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="searchParams.deviceCode" placeholder="请输入编号" clearable />
<el-form-item :label="t('FactoryModeling.ProductInformation.deviceCodeLabel')" prop="deviceCode">
<el-input v-model="searchParams.deviceCode" :placeholder="t('FactoryModeling.ProductInformation.codePlaceholder')" clearable />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="searchParams.deviceName" placeholder="请输入名称" clearable />
<el-form-item :label="t('FactoryModeling.ProductInformation.deviceNameLabel')" prop="deviceName">
<el-input v-model="searchParams.deviceName" :placeholder="t('FactoryModeling.ProductInformation.namePlaceholder')" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">{{ t('FactoryModeling.ProductInformation.searchButtonText')
@ -241,15 +241,15 @@
</el-form>
</template>
</TableSelectDialog>
<TableSelectDialog ref="moldSelectDialogRef" title="选择模具" :columns="moldColumns" :fetch-api="MoldBrandApi.getMoldPage"
<TableSelectDialog ref="moldSelectDialogRef" :title="t('FactoryModeling.ProductInformation.moldSelectTitle')" :columns="moldColumns" :fetch-api="MoldBrandApi.getMoldPage"
row-key="id" @confirm="handleMoldSelectConfirm" :query-params="mergedMoldQueryParams">
<template #header>
<el-form ref="searchMoldFormRef" :model="searchMoldParams" :inline="true">
<el-form-item label="模具编号" prop="code">
<el-input v-model="searchMoldParams.code" placeholder="请输入编号" clearable />
<el-form-item :label="t('FactoryModeling.ProductInformation.moldCodeLabel')" prop="code">
<el-input v-model="searchMoldParams.code" :placeholder="t('FactoryModeling.ProductInformation.codePlaceholder')" clearable />
</el-form-item>
<el-form-item label="模具名称" prop="name">
<el-input v-model="searchMoldParams.name" placeholder="请输入名称" clearable />
<el-form-item :label="t('FactoryModeling.ProductInformation.moldNameLabel')" prop="name">
<el-input v-model="searchMoldParams.name" :placeholder="t('FactoryModeling.ProductInformation.namePlaceholder')" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleMoldSearch">{{
@ -337,7 +337,7 @@
<el-table-column :label="t('ErpPurchase.Supplier.contact')" prop="contact" minWidth="100" />
<el-table-column :label="t('ErpPurchase.Supplier.mobile')" prop="mobile" minWidth="120" />
<el-table-column :label="t('ErpPurchase.Supplier.telephone')" prop="telephone" minWidth="120" />
<el-table-column label="是否默认供应商" width="130" align="center">
<el-table-column :label="t('FactoryModeling.ProductInformation.defaultSupplierColumn')" width="130" align="center">
<template #default="{ row }">
<el-radio v-model="supplierDefaultId" :label="row.id"
:disabled="!supplierSelectedRows.some((item) => item.id === row.id)">
@ -537,25 +537,25 @@ const toMoldRows = (molds: { id: string | number; name: string }[]) => {
}
const deviceDisplayText = computed(() => {
if (!formData.value.devices.length) return ''
if (!selectedDeviceRows.value.length) return formData.value.devices.map((item) => item.name).join('、')
return selectedDeviceRows.value.map((item) => item.deviceName || item.name || item.code || `ID:${item.id}`).join('、')
if (!selectedDeviceRows.value.length) return formData.value.devices.map((item) => item.name).join(t('FactoryModeling.ProductInformation.listSeparator'))
return selectedDeviceRows.value.map((item) => item.deviceName || item.name || item.code || `ID:${item.id}`).join(t('FactoryModeling.ProductInformation.listSeparator'))
})
const moldDisplayText = computed(() => {
if (!formData.value.molds.length) return ''
if (!selectedMoldRows.value.length) return formData.value.molds.map((item) => item.name).join('、')
return selectedMoldRows.value.map((item) => item.name || item.code || `ID:${item.id}`).join('、')
if (!selectedMoldRows.value.length) return formData.value.molds.map((item) => item.name).join(t('FactoryModeling.ProductInformation.listSeparator'))
return selectedMoldRows.value.map((item) => item.name || item.code || `ID:${item.id}`).join(t('FactoryModeling.ProductInformation.listSeparator'))
})
const deviceColumns = [
{ label: '设备编号', prop: 'deviceCode', minWidth: 140 },
{ label: '设备名称', prop: 'deviceName', minWidth: 160 },
{ label: '设备型号', prop: 'deviceModel', minWidth: 140 },
{ label: '所属车间', prop: 'workshopName', minWidth: 140 }
{ label: t('FactoryModeling.ProductInformation.deviceCodeLabel'), prop: 'deviceCode', minWidth: 140 },
{ label: t('FactoryModeling.ProductInformation.deviceNameLabel'), prop: 'deviceName', minWidth: 160 },
{ label: t('FactoryModeling.ProductInformation.deviceModelLabel'), prop: 'deviceModel', minWidth: 140 },
{ label: t('FactoryModeling.ProductInformation.workshopLabel'), prop: 'workshopName', minWidth: 140 }
]
const moldColumns = [
{ label: '模具编码', prop: 'code', minWidth: 140 },
{ label: '模具名称', prop: 'name', minWidth: 160 },
{ label: '模具型号', prop: 'brandName', minWidth: 140 },
{ label: '状态', prop: 'status', minWidth: 100 }
{ label: t('FactoryModeling.ProductInformation.moldCodeLabel'), prop: 'code', minWidth: 140 },
{ label: t('FactoryModeling.ProductInformation.moldNameLabel'), prop: 'name', minWidth: 160 },
{ label: t('FactoryModeling.ProductInformation.moldModelLabel'), prop: 'brandName', minWidth: 140 },
{ label: t('FactoryModeling.ProductInformation.tableStatusColumn'), prop: 'status', minWidth: 100 }
]
const fetchDeviceLedgerPage = (params: Record<string, any>) => {
return DeviceLedgerApi.getDeviceLedgerPage({
@ -582,7 +582,7 @@ const handleDeviceSelectConfirm = (payload: { ids: (number | string)[]; rows: an
const id = String(item.id)
return {
id,
name: item.deviceName || item.name || item.code || `设备ID:${id}`
name: item.deviceName || item.name || item.code || t('FactoryModeling.ProductInformation.deviceIdFallback', { id })
}
})
.filter((item): item is { id: string | number; name: string } => Boolean(item))
@ -594,7 +594,7 @@ const handleMoldSelectConfirm = (payload: { ids: (number | string)[]; rows: any[
const id = String(item.id)
return {
id,
name: item.name || item.code || `模具ID:${id}`
name: item.name || item.code || t('FactoryModeling.ProductInformation.moldIdFallback', { id })
}
})
.filter((item): item is { id: string | number; name: string } => Boolean(item))
@ -707,7 +707,7 @@ const displayPackagingSchemeText = computed(() => {
return scheme?.name || ''
})
.filter(Boolean)
.join('、')
.join(t('FactoryModeling.ProductInformation.listSeparator'))
})
const openPackagingSchemeDialog = async () => {
@ -834,7 +834,7 @@ const displaySupplierText = computed(() => {
return supplier?.name || ''
})
.filter(Boolean)
.join('、')
.join(t('FactoryModeling.ProductInformation.listSeparator'))
})
const openSupplierDialog = async () => {
@ -1053,7 +1053,7 @@ const onAddUnit = (type: 'unit' | 'purchaseUnit') => {
const onConfirmAddUnit = async (type: 'unit' | 'purchaseUnit') => {
if (!unitInputName.value.trim()) {
message.warning('请输入单位名称')
message.warning(t('FactoryModeling.ProductInformation.unitNameRequired'))
return
}
formLoading.value = true
@ -1077,7 +1077,7 @@ const onConfirmAddUnit = async (type: 'unit' | 'purchaseUnit') => {
}
}
clearAddUnit()
message.success('新增单位成功')
message.success(t('FactoryModeling.ProductInformation.addUnitSuccess'))
} finally {
formLoading.value = false
}

@ -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 '-'

@ -58,7 +58,7 @@
<template #label>
<span>
{{ t('FactoryModeling.ProductUnit.dialogChangeRateLabel') }}
<el-tooltip content="与主单位换算比例s = 1000 ms换算比例为1000" placement="top">
<el-tooltip :content="t('FactoryModeling.ProductUnit.dialogChangeRateTooltip')" placement="top">
<Icon icon="ep:question-filled" />
</el-tooltip>
</span>

@ -139,6 +139,6 @@ const handleExceed = (): void => {
/** 下载模板操作 */
const importTemplate = async () => {
const res = await ProductUnitApi.importProductUnitTemplate()
download.excel(res, '单位导入模版.xls')
download.excel(res, t('FactoryModeling.ProductUnit.importTemplateFilename'))
}
</script>

@ -251,7 +251,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await ProductUnitApi.exportProductUnit(queryParams)
download.excel(data, '产品单位.xls')
download.excel(data, t('FactoryModeling.ProductUnit.exportFilename'))
} catch {
} finally {
exportLoading.value = false

Loading…
Cancel
Save