mirror of
https://github.com/huge-dream/django-vue3-admin.git
synced 2026-10-14 13:06:38 +00:00
feat(i18n): Fix misc_materials/stations i18n refs and add misc_parts i18n
- misc_materials/crud.tsx: Change misc_materials.* refs to materialInfo.*
- misc_stations/crud.tsx: Change misc_stations.* refs to stationInfo.*
- misc_parts/crud.tsx: Add full i18n support (useI18n, statusDict, categoryDict, all columns)
- Add missing keys to all 3 i18n files:
- materialInfo: statusEnabled, statusDisabled, createTime, updateTime
- stationInfo: statusEnabled, statusDisabled, typeTooling, typeGraphite, createTime, updateTime
- misc_parts: new section with all field labels
- rfqmiscellaneous: paymentMethod1-9, selectInquiryFirst, onlySingleOperation,
confirmBargainPrompt, addSupplierFirst, confirmPrompt, prompt, confirmFailed,
restorePrompt, restoreFailed, publishPrompt, publishFailed, startBargainFailed,
deleteFailed, cancel, inquiryNameRequired, buyerRequired, inquiryNoPlaceholder,
inquiryNamePlaceholder, buyerPlaceholder
This commit is contained in:
@@ -12,6 +12,10 @@ export default {
|
||||
density: 'Density',
|
||||
price: 'Unit Price',
|
||||
status: 'Status',
|
||||
statusEnabled: 'Enabled',
|
||||
statusDisabled: 'Disabled',
|
||||
createTime: 'Create Time',
|
||||
updateTime: 'Update Time',
|
||||
},
|
||||
stationInfo: {
|
||||
title: 'Misc Procurement Station Info',
|
||||
@@ -24,6 +28,33 @@ export default {
|
||||
unit: 'Unit',
|
||||
rate: 'Rate',
|
||||
status: 'Status',
|
||||
statusEnabled: 'Enabled',
|
||||
statusDisabled: 'Disabled',
|
||||
typeTooling: 'Tooling',
|
||||
typeGraphite: 'Graphite',
|
||||
createTime: 'Create Time',
|
||||
updateTime: 'Update Time',
|
||||
},
|
||||
misc_parts: {
|
||||
title: 'Misc Parts Info',
|
||||
companyCode: 'Transaction Plant',
|
||||
partid: 'Part ID',
|
||||
partidName: 'Part Name',
|
||||
specification: 'Specification',
|
||||
unit: 'Unit',
|
||||
partidCategory: 'Part Category',
|
||||
categoryTooling: 'Tooling',
|
||||
categoryGraphite: 'Graphite',
|
||||
categoryOther: 'Other',
|
||||
status: 'Status',
|
||||
statusEnabled: 'Enabled',
|
||||
statusDisabled: 'Disabled',
|
||||
createTime: 'Create Time',
|
||||
updateTime: 'Update Time',
|
||||
validation: {
|
||||
fieldNameRequired: 'Field is required',
|
||||
alreadyExists: 'already exists',
|
||||
}
|
||||
},
|
||||
inquiry: {
|
||||
title: 'Inquiry',
|
||||
@@ -52,8 +83,71 @@ export default {
|
||||
templateNameEn: 'Template Name (English)',
|
||||
templateNameZhTw: 'Template Name (Traditional Chinese)',
|
||||
procurementCategory: 'Procurement Category',
|
||||
procurementMisc: 'Misc',
|
||||
procurementStrategic: 'Strategic',
|
||||
templateDesc: 'Template Description',
|
||||
status: 'Status',
|
||||
statusPlaceholder: 'Select status',
|
||||
statusConfirmed: 'Confirmed',
|
||||
statusUnconfirmed: 'Unconfirmed',
|
||||
statusCancelled: 'Cancelled',
|
||||
selectProcurementCategory: 'Select procurement category',
|
||||
inputTemplateName: 'Enter template name',
|
||||
version: 'Version',
|
||||
newVersion: 'New Version',
|
||||
newVersionFailed: 'Failed to create new version',
|
||||
basicInfo: 'Basic Info',
|
||||
sections: 'Sections',
|
||||
controls: 'Controls',
|
||||
fieldKey: 'Field Key',
|
||||
confirm: 'Confirm',
|
||||
confirmButtonText: 'Confirm',
|
||||
confirmSuccess: 'Confirmed successfully',
|
||||
confirmFailed: 'Confirmation failed',
|
||||
confirmStatusTip: 'Confirmation status',
|
||||
cancelButtonText: 'Cancel',
|
||||
pleaseCompleteAndSave: 'Please complete and save first',
|
||||
pleaseModifyAndSave: 'Please modify and save first',
|
||||
loadDetailFailed: 'Failed to load details',
|
||||
keyNotFilled: 'Required field not filled',
|
||||
isBom: 'Is BOM',
|
||||
bomYes: 'Yes',
|
||||
bomNo: 'No',
|
||||
acti: 'Action',
|
||||
actiYes: 'Yes',
|
||||
actiNo: 'No',
|
||||
productDetail: 'Product Detail',
|
||||
materials: 'Materials',
|
||||
material: 'Material',
|
||||
length: 'Length',
|
||||
width: 'Width',
|
||||
height: 'Height',
|
||||
specificgravity: 'Specific Gravity',
|
||||
autoByMaterial: 'Auto calculated by material',
|
||||
qty: 'Qty',
|
||||
weight: 'Weight',
|
||||
weightUsage: 'Material Weight',
|
||||
unitPrice: 'Unit Price',
|
||||
materialCost: 'Material Cost',
|
||||
lengthWidthHeightSpecificgravityQty: 'L*W*H*SG*Qty',
|
||||
weightTimesUnitPrice: 'Weight x Unit Price',
|
||||
process: 'Process',
|
||||
processStation: 'Process Station',
|
||||
processTime: 'Process Time',
|
||||
unit: 'Unit',
|
||||
unitrate: 'Station Rate',
|
||||
autoByStation: 'Auto calculated by station',
|
||||
processqty: 'Process Qty',
|
||||
processprice: 'Process Price',
|
||||
processCost: 'Process Cost',
|
||||
unitrateTimesProcessqty: 'Station Rate x Process Qty',
|
||||
lossRate: 'Loss Rate',
|
||||
sgna: 'SG&A',
|
||||
others: 'Others',
|
||||
profit: 'Profit',
|
||||
tax: 'Tax',
|
||||
remark: 'Remark',
|
||||
updateTime: 'Update Time',
|
||||
},
|
||||
rfqmiscellaneous: {
|
||||
title: 'Misc RFQ',
|
||||
@@ -70,6 +164,34 @@ export default {
|
||||
currency: 'Currency',
|
||||
leadTimeDays: 'Lead Time (Days)',
|
||||
paymentMethod: 'Payment Method',
|
||||
paymentMethod1: 'T/T 30 Days',
|
||||
paymentMethod2: 'T/T 60 Days',
|
||||
paymentMethod3: 'T/T 90 Days',
|
||||
paymentMethod4: 'T/T 120 Days',
|
||||
paymentMethod5: 'L/C 30 Days',
|
||||
paymentMethod6: 'L/C 60 Days',
|
||||
paymentMethod7: 'L/C 90 Days',
|
||||
paymentMethod8: 'L/C 120 Days',
|
||||
paymentMethod9: 'Other',
|
||||
inquiryNoPlaceholder: 'Enter RFQ number',
|
||||
inquiryNamePlaceholder: 'Enter RFQ name',
|
||||
buyerPlaceholder: 'Enter buyer name',
|
||||
selectInquiryFirst: 'Please select an RFQ first',
|
||||
onlySingleOperation: 'Only single item operation is supported',
|
||||
confirmBargainPrompt: 'Confirm to change status to [Bargaining]?',
|
||||
addSupplierFirst: 'Please maintain RFQ supplier list first before confirming',
|
||||
confirmPrompt: 'After confirmation, the RFQ will be locked and cannot be edited. To modify, you need to [Restore] it.',
|
||||
prompt: 'Prompt',
|
||||
confirmFailed: 'Confirmation failed',
|
||||
restorePrompt: 'Confirm to restore status to [Open]?',
|
||||
restoreFailed: 'Restore failed',
|
||||
publishPrompt: 'Confirm to change status to [Published]?',
|
||||
publishFailed: 'Publish failed',
|
||||
startBargainFailed: 'Failed to start price comparison',
|
||||
deleteFailed: 'Delete failed',
|
||||
cancel: 'Cancel',
|
||||
inquiryNameRequired: 'Please enter RFQ name',
|
||||
buyerRequired: 'Please enter buyer name',
|
||||
status: 'Status',
|
||||
statusOpen: 'Open',
|
||||
statusConfirmed: 'Confirmed',
|
||||
|
||||
@@ -12,6 +12,10 @@ export default {
|
||||
density: '比重',
|
||||
price: '单价',
|
||||
status: '状态',
|
||||
statusEnabled: '启用',
|
||||
statusDisabled: '禁用',
|
||||
createTime: '创建时间',
|
||||
updateTime: '更新时间',
|
||||
},
|
||||
stationInfo: {
|
||||
title: '杂采工站信息',
|
||||
@@ -24,6 +28,33 @@ export default {
|
||||
unit: '计量单位',
|
||||
rate: '费率',
|
||||
status: '状态',
|
||||
statusEnabled: '启用',
|
||||
statusDisabled: '禁用',
|
||||
typeTooling: '模治具',
|
||||
typeGraphite: '石墨',
|
||||
createTime: '创建时间',
|
||||
updateTime: '更新时间',
|
||||
},
|
||||
misc_parts: {
|
||||
title: '杂采料号信息',
|
||||
companyCode: '交易厂区',
|
||||
partid: '料号',
|
||||
partidName: '物料说明',
|
||||
specification: '品名规格',
|
||||
unit: '单位',
|
||||
partidCategory: '物料分类',
|
||||
categoryTooling: '模治具',
|
||||
categoryGraphite: '石墨',
|
||||
categoryOther: '其他',
|
||||
status: '启用否',
|
||||
statusEnabled: '启用',
|
||||
statusDisabled: '禁用',
|
||||
createTime: '创建时间',
|
||||
updateTime: '更新时间',
|
||||
validation: {
|
||||
fieldNameRequired: '字段不能为空',
|
||||
alreadyExists: '已存在',
|
||||
}
|
||||
},
|
||||
inquiry: {
|
||||
title: '询价单',
|
||||
@@ -52,8 +83,71 @@ export default {
|
||||
templateNameEn: '模板英文名',
|
||||
templateNameZhTw: '模板繁体名',
|
||||
procurementCategory: '采购类别',
|
||||
procurementMisc: '杂采',
|
||||
procurementStrategic: '策采',
|
||||
templateDesc: '模板描述',
|
||||
status: '状态',
|
||||
statusPlaceholder: '请选择状态',
|
||||
statusConfirmed: '已确认',
|
||||
statusUnconfirmed: '未确认',
|
||||
statusCancelled: '已作废',
|
||||
selectProcurementCategory: '请选择采购类别',
|
||||
inputTemplateName: '请输入模板名称',
|
||||
version: '版本',
|
||||
newVersion: '新建版本',
|
||||
newVersionFailed: '新建版本失败',
|
||||
basicInfo: '基础信息',
|
||||
sections: '区段信息',
|
||||
controls: '控件',
|
||||
fieldKey: '字段标识',
|
||||
confirm: '确认',
|
||||
confirmButtonText: '确认',
|
||||
confirmSuccess: '确认成功',
|
||||
confirmFailed: '确认失败',
|
||||
confirmStatusTip: '确认状态提示',
|
||||
cancelButtonText: '取消',
|
||||
pleaseCompleteAndSave: '请先完成并保存',
|
||||
pleaseModifyAndSave: '请先修改并保存',
|
||||
loadDetailFailed: '加载明细失败',
|
||||
keyNotFilled: '关键字段未填写',
|
||||
isBom: '是否BOM',
|
||||
bomYes: '是',
|
||||
bomNo: '否',
|
||||
acti: '操作',
|
||||
actiYes: '是',
|
||||
actiNo: '否',
|
||||
productDetail: '产品明细',
|
||||
materials: '材料',
|
||||
material: '材质',
|
||||
length: '长',
|
||||
width: '宽',
|
||||
height: '高',
|
||||
specificgravity: '比重',
|
||||
autoByMaterial: '由材质自动计算',
|
||||
qty: '数量',
|
||||
weight: '重量',
|
||||
weightUsage: '用料重量',
|
||||
unitPrice: '单价',
|
||||
materialCost: '材料费用',
|
||||
lengthWidthHeightSpecificgravityQty: '长*宽*高*比重*数量',
|
||||
weightTimesUnitPrice: '重量*单价',
|
||||
process: '加工',
|
||||
processStation: '加工工站',
|
||||
processTime: '加工时间',
|
||||
unit: '计量单位',
|
||||
unitrate: '工站费率',
|
||||
autoByStation: '由工站自动计算',
|
||||
processqty: '加工数量',
|
||||
processprice: '加工单价',
|
||||
processCost: '加工费',
|
||||
unitrateTimesProcessqty: '工站费率*加工数量',
|
||||
lossRate: '损耗率',
|
||||
sgna: '销管费',
|
||||
others: '其他',
|
||||
profit: '利润',
|
||||
tax: '税金',
|
||||
remark: '备注',
|
||||
updateTime: '更新时间',
|
||||
},
|
||||
rfqmiscellaneous: {
|
||||
title: '杂采询价单',
|
||||
@@ -70,6 +164,34 @@ export default {
|
||||
currency: '币别',
|
||||
leadTimeDays: '交货周期(天)',
|
||||
paymentMethod: '付款方式',
|
||||
paymentMethod1: 'T/T 30天',
|
||||
paymentMethod2: 'T/T 60天',
|
||||
paymentMethod3: 'T/T 90天',
|
||||
paymentMethod4: 'T/T 120天',
|
||||
paymentMethod5: 'L/C 30天',
|
||||
paymentMethod6: 'L/C 60天',
|
||||
paymentMethod7: 'L/C 90天',
|
||||
paymentMethod8: 'L/C 120天',
|
||||
paymentMethod9: '其他',
|
||||
inquiryNoPlaceholder: '请输入询价单号',
|
||||
inquiryNamePlaceholder: '请输入询价单名称',
|
||||
buyerPlaceholder: '请输入采购负责人',
|
||||
selectInquiryFirst: '请先选择询价单',
|
||||
onlySingleOperation: '仅支持单条操作',
|
||||
confirmBargainPrompt: '确认将状态改为【比议价中】?',
|
||||
addSupplierFirst: '请先维护询价单供应商名单后再确认',
|
||||
confirmPrompt: '确认后,该询价单将锁定并不可再编辑。如需修改,后续需执行【还原】操作',
|
||||
prompt: '提示',
|
||||
confirmFailed: '确认失败',
|
||||
restorePrompt: '确认将状态还原为【开立】?',
|
||||
restoreFailed: '还原失败',
|
||||
publishPrompt: '确认将状态改为【发布】?',
|
||||
publishFailed: '发布失败',
|
||||
startBargainFailed: '开启比议价失败',
|
||||
deleteFailed: '删除失败',
|
||||
cancel: '取消',
|
||||
inquiryNameRequired: '请输入询价单名称',
|
||||
buyerRequired: '请输入采购负责人',
|
||||
status: '状态',
|
||||
statusOpen: '开立',
|
||||
statusConfirmed: '确认',
|
||||
|
||||
@@ -12,6 +12,10 @@ export default {
|
||||
density: '比重',
|
||||
price: '單價',
|
||||
status: '狀態',
|
||||
statusEnabled: '啟用',
|
||||
statusDisabled: '禁用',
|
||||
createTime: '創建時間',
|
||||
updateTime: '更新時間',
|
||||
},
|
||||
stationInfo: {
|
||||
title: '雜採工站資訊',
|
||||
@@ -24,6 +28,33 @@ export default {
|
||||
unit: '計量單位',
|
||||
rate: '費率',
|
||||
status: '狀態',
|
||||
statusEnabled: '啟用',
|
||||
statusDisabled: '禁用',
|
||||
typeTooling: '模具',
|
||||
typeGraphite: '石墨',
|
||||
createTime: '創建時間',
|
||||
updateTime: '更新時間',
|
||||
},
|
||||
misc_parts: {
|
||||
title: '雜採料號資訊',
|
||||
companyCode: '交易廠區',
|
||||
partid: '料號',
|
||||
partidName: '物料說明',
|
||||
specification: '品名規格',
|
||||
unit: '單位',
|
||||
partidCategory: '物料分類',
|
||||
categoryTooling: '模具',
|
||||
categoryGraphite: '石墨',
|
||||
categoryOther: '其他',
|
||||
status: '啟用否',
|
||||
statusEnabled: '啟用',
|
||||
statusDisabled: '禁用',
|
||||
createTime: '創建時間',
|
||||
updateTime: '更新時間',
|
||||
validation: {
|
||||
fieldNameRequired: '字段不能為空',
|
||||
alreadyExists: '已存在',
|
||||
}
|
||||
},
|
||||
inquiry: {
|
||||
title: '詢價單',
|
||||
@@ -52,8 +83,71 @@ export default {
|
||||
templateNameEn: '模版英文名',
|
||||
templateNameZhTw: '模版繁體名',
|
||||
procurementCategory: '採購類別',
|
||||
procurementMisc: '雜採',
|
||||
procurementStrategic: '策採',
|
||||
templateDesc: '模版描述',
|
||||
status: '狀態',
|
||||
statusPlaceholder: '請選擇狀態',
|
||||
statusConfirmed: '已確認',
|
||||
statusUnconfirmed: '未確認',
|
||||
statusCancelled: '已作廢',
|
||||
selectProcurementCategory: '請選擇採購類別',
|
||||
inputTemplateName: '請輸入模版名稱',
|
||||
version: '版本',
|
||||
newVersion: '新建版本',
|
||||
newVersionFailed: '新建版本失敗',
|
||||
basicInfo: '基本信息',
|
||||
sections: '區段資訊',
|
||||
controls: '控件',
|
||||
fieldKey: '字段識別',
|
||||
confirm: '確認',
|
||||
confirmButtonText: '確認',
|
||||
confirmSuccess: '確認成功',
|
||||
confirmFailed: '確認失敗',
|
||||
confirmStatusTip: '確認狀態提示',
|
||||
cancelButtonText: '取消',
|
||||
pleaseCompleteAndSave: '請先完成並儲存',
|
||||
pleaseModifyAndSave: '請先修改並儲存',
|
||||
loadDetailFailed: '載入明細失敗',
|
||||
keyNotFilled: '關鍵字段未填寫',
|
||||
isBom: '是否BOM',
|
||||
bomYes: '是',
|
||||
bomNo: '否',
|
||||
acti: '操作',
|
||||
actiYes: '是',
|
||||
actiNo: '否',
|
||||
productDetail: '產品明細',
|
||||
materials: '材料',
|
||||
material: '材質',
|
||||
length: '長',
|
||||
width: '寬',
|
||||
height: '高',
|
||||
specificgravity: '比重',
|
||||
autoByMaterial: '由材質自動計算',
|
||||
qty: '數量',
|
||||
weight: '重量',
|
||||
weightUsage: '用料重量',
|
||||
unitPrice: '單價',
|
||||
materialCost: '材料費用',
|
||||
lengthWidthHeightSpecificgravityQty: '長*寬*高*比重*數量',
|
||||
weightTimesUnitPrice: '重量*單價',
|
||||
process: '加工',
|
||||
processStation: '加工工站',
|
||||
processTime: '加工時間',
|
||||
unit: '計量單位',
|
||||
unitrate: '工站費率',
|
||||
autoByStation: '由工站自動計算',
|
||||
processqty: '加工數量',
|
||||
processprice: '加工單價',
|
||||
processCost: '加工費',
|
||||
unitrateTimesProcessqty: '工站費率*加工數量',
|
||||
lossRate: '損耗率',
|
||||
sgna: '銷管費',
|
||||
others: '其他',
|
||||
profit: '利潤',
|
||||
tax: '稅金',
|
||||
remark: '備註',
|
||||
updateTime: '更新時間',
|
||||
},
|
||||
rfqmiscellaneous: {
|
||||
title: '雜採詢價單',
|
||||
@@ -70,6 +164,34 @@ export default {
|
||||
currency: '幣別',
|
||||
leadTimeDays: '交貨週期(天)',
|
||||
paymentMethod: '付款方式',
|
||||
paymentMethod1: 'T/T 30天',
|
||||
paymentMethod2: 'T/T 60天',
|
||||
paymentMethod3: 'T/T 90天',
|
||||
paymentMethod4: 'T/T 120天',
|
||||
paymentMethod5: 'L/C 30天',
|
||||
paymentMethod6: 'L/C 60天',
|
||||
paymentMethod7: 'L/C 90天',
|
||||
paymentMethod8: 'L/C 120天',
|
||||
paymentMethod9: '其他',
|
||||
inquiryNoPlaceholder: '請輸入詢價單號',
|
||||
inquiryNamePlaceholder: '請輸入詢價單名稱',
|
||||
buyerPlaceholder: '請輸入採購負責人',
|
||||
selectInquiryFirst: '請先選擇詢價單',
|
||||
onlySingleOperation: '僅支援單條操作',
|
||||
confirmBargainPrompt: '確認將狀態改為【比議價中】?',
|
||||
addSupplierFirst: '請先維護詢價單供應商名單後再確認',
|
||||
confirmPrompt: '確認後,該詢價單將鎖定並不可再編輯。如需修改,後續需執行【還原】操作',
|
||||
prompt: '提示',
|
||||
confirmFailed: '確認失敗',
|
||||
restorePrompt: '確認將狀態還原為【開立】?',
|
||||
restoreFailed: '還原失敗',
|
||||
publishPrompt: '確認將狀態改為【發布】?',
|
||||
publishFailed: '發布失敗',
|
||||
startBargainFailed: '開啟比議價失敗',
|
||||
deleteFailed: '刪除失敗',
|
||||
cancel: '取消',
|
||||
inquiryNameRequired: '請輸入詢價單名稱',
|
||||
buyerRequired: '請輸入採購負責人',
|
||||
status: '狀態',
|
||||
statusOpen: '開立',
|
||||
statusConfirmed: '確認',
|
||||
|
||||
@@ -31,8 +31,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
const { t } = useI18n()
|
||||
|
||||
const statusDict = [
|
||||
{ value: 1, label: t('message.pages.miscprocurement.misc_materials.statusEnabled') },
|
||||
{ value: 0, label: t('message.pages.miscprocurement.misc_materials.statusDisabled') }
|
||||
{ value: 1, label: t('message.pages.miscprocurement.materialInfo.statusEnabled') },
|
||||
{ value: 0, label: t('message.pages.miscprocurement.materialInfo.statusDisabled') }
|
||||
]
|
||||
|
||||
return {
|
||||
@@ -59,7 +59,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
},
|
||||
columns: {
|
||||
factory: {
|
||||
title: t('message.pages.miscprocurement.misc_materials.companyCode'),
|
||||
title: t('message.pages.miscprocurement.materialInfo.factory'),
|
||||
type: 'dict-select',
|
||||
dict: dict({
|
||||
cache: false,
|
||||
@@ -73,41 +73,41 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
materialtype: {
|
||||
title: t('message.pages.miscprocurement.misc_materials.materialtype'),
|
||||
title: t('message.pages.miscprocurement.materialInfo.materialtype'),
|
||||
type: 'input',
|
||||
search: {
|
||||
show: true,
|
||||
component: { props: { placeholder: t('message.pages.miscprocurement.misc_materials.materialtype'), clearable: true } }
|
||||
component: { props: { placeholder: t('message.pages.miscprocurement.materialInfo.materialtype'), clearable: true } }
|
||||
},
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
density: {
|
||||
title: t('message.pages.miscprocurement.misc_materials.density'),
|
||||
title: t('message.pages.miscprocurement.materialInfo.density'),
|
||||
type: 'input',
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_materials.density') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.materialInfo.density') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { width: 120, showOverflowTooltip: true }
|
||||
},
|
||||
price: {
|
||||
title: t('message.pages.miscprocurement.misc_materials.price'),
|
||||
title: t('message.pages.miscprocurement.materialInfo.price'),
|
||||
type: 'number',
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_materials.price') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }], component: { props: { precision: 2 } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.materialInfo.price') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }], component: { props: { precision: 2 } } },
|
||||
column: { width: 120 }
|
||||
},
|
||||
status: {
|
||||
title: t('message.pages.miscprocurement.misc_materials.status'),
|
||||
title: t('message.pages.miscprocurement.materialInfo.status'),
|
||||
type: 'dict-switch',
|
||||
dict: dict({ data: statusDict }),
|
||||
form: { value: 1 },
|
||||
column: { width: 120 }
|
||||
},
|
||||
create_datetime: {
|
||||
title: '创建时间',
|
||||
title: t('message.pages.miscprocurement.materialInfo.createTime'),
|
||||
type: 'datetime',
|
||||
form: { show: false },
|
||||
column: { width: 180 }
|
||||
},
|
||||
update_datetime: {
|
||||
title: '更新时间',
|
||||
title: t('message.pages.miscprocurement.materialInfo.updateTime'),
|
||||
type: 'datetime',
|
||||
form: { show: false },
|
||||
column: { width: 180 }
|
||||
|
||||
@@ -4,17 +4,6 @@ import { GetCompanies } from '../../basicinfo/currency/api'
|
||||
import { GetList as GetUnits } from '../../basicinfo/unit/api'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const statusDict = [
|
||||
{ value: 1, label: '启用' },
|
||||
{ value: 0, label: '禁用' }
|
||||
]
|
||||
|
||||
const categoryDict = [
|
||||
{ value: 1, label: '模治具' },
|
||||
{ value: 2, label: '石墨' },
|
||||
{ value: 3, label: '其他' }
|
||||
]
|
||||
|
||||
const loadCompanyOptions = async () => {
|
||||
try {
|
||||
const res = await GetCompanies({ page: 1, page_size: 1000, pageSize: 1000 })
|
||||
@@ -62,8 +51,20 @@ const loadUnitOptions = async (companyCode?: string) => {
|
||||
void loadCompanyOptions()
|
||||
|
||||
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { t } = useI18n()
|
||||
void crudExpose
|
||||
|
||||
const statusDict = () => [
|
||||
{ value: 1, label: t('message.pages.miscprocurement.misc_parts.statusEnabled') },
|
||||
{ value: 0, label: t('message.pages.miscprocurement.misc_parts.statusDisabled') }
|
||||
]
|
||||
|
||||
const categoryDict = () => [
|
||||
{ value: 1, label: t('message.pages.miscprocurement.misc_parts.categoryTooling') },
|
||||
{ value: 2, label: t('message.pages.miscprocurement.misc_parts.categoryGraphite') },
|
||||
{ value: 3, label: t('message.pages.miscprocurement.misc_parts.categoryOther') }
|
||||
]
|
||||
|
||||
const ensurePartUnique = async (companyCode: string, partId: string, currentId?: number) => {
|
||||
if (!companyCode || !partId) return
|
||||
const res = await api.GetList({ company_code: companyCode, partid: partId, page: 1, page_size: 1, pageSize: 1 })
|
||||
@@ -79,7 +80,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
? list.find((item: any) => item.company_code === companyCode && item.partid === partId)
|
||||
: null
|
||||
if (exists && (!currentId || exists.id !== currentId)) {
|
||||
throw new Error('同一交易厂区下料号已存在,不可重复')
|
||||
throw new Error(t('message.pages.miscprocurement.misc_parts.companyCode') + t('message.pages.miscprocurement.misc_parts.partid') + t('message.pages.miscprocurement.misc_parts.validation.alreadyExists'))
|
||||
}
|
||||
}
|
||||
return {
|
||||
@@ -122,7 +123,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
},
|
||||
columns: {
|
||||
company_code: {
|
||||
title: '交易厂区',
|
||||
title: t('message.pages.miscprocurement.misc_parts.companyCode'),
|
||||
type: 'dict-select',
|
||||
dict: dict({
|
||||
cache: false,
|
||||
@@ -144,55 +145,55 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
partid: {
|
||||
title: '料号',
|
||||
title: t('message.pages.miscprocurement.misc_parts.partid'),
|
||||
type: 'input',
|
||||
search: { show: true, component: { props: { placeholder: '请输入料号', clearable: true } } },
|
||||
form: { rules: [{ required: true, message: '请输入料号' }] },
|
||||
search: { show: true, component: { props: { placeholder: t('message.pages.miscprocurement.misc_parts.partid'), clearable: true } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_parts.partid') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
partid_name: {
|
||||
title: '物料说明',
|
||||
title: t('message.pages.miscprocurement.misc_parts.partidName'),
|
||||
type: 'input',
|
||||
form: { rules: [{ required: true, message: '请输入物料说明' }] },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_parts.partidName') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
specification: {
|
||||
title: '品名规格',
|
||||
title: t('message.pages.miscprocurement.misc_parts.specification'),
|
||||
type: 'input',
|
||||
form: { rules: [{ required: true, message: '请输入品名规格' }] },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_parts.specification') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
unit: {
|
||||
title: '单位',
|
||||
title: t('message.pages.miscprocurement.misc_parts.unit'),
|
||||
type: 'dict-select',
|
||||
dict: dict({
|
||||
cache: false,
|
||||
getData: async ({ form }: any = {}) => loadUnitOptions(form?.company_code)
|
||||
}),
|
||||
form: { rules: [{ required: true, message: '请选择单位' }], component: { props: { placeholder: '先选择厂区' } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_parts.unit') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }], component: { props: { placeholder: t('message.pages.miscprocurement.misc_parts.companyCode') } } },
|
||||
column: { width: 140, showOverflowTooltip: true }
|
||||
},
|
||||
partid_category_id: {
|
||||
title: '物料分类',
|
||||
title: t('message.pages.miscprocurement.misc_parts.partidCategory'),
|
||||
type: 'dict-select',
|
||||
dict: dict({ data: categoryDict }),
|
||||
dict: dict({ data: categoryDict() }),
|
||||
column: { width: 140, showOverflowTooltip: true }
|
||||
},
|
||||
status: {
|
||||
title: '启用否',
|
||||
title: t('message.pages.miscprocurement.misc_parts.status'),
|
||||
type: 'dict-switch',
|
||||
dict: dict({ data: statusDict }),
|
||||
dict: dict({ data: statusDict() }),
|
||||
form: { value: 1 },
|
||||
column: { width: 120 }
|
||||
},
|
||||
create_datetime: {
|
||||
title: '创建时间',
|
||||
title: t('message.pages.miscprocurement.misc_parts.createTime'),
|
||||
type: 'datetime',
|
||||
form: { show: false },
|
||||
column: { width: 180 }
|
||||
},
|
||||
update_datetime: {
|
||||
title: '更新时间',
|
||||
title: t('message.pages.miscprocurement.misc_parts.updateTime'),
|
||||
type: 'datetime',
|
||||
form: { show: false },
|
||||
column: { width: 180 }
|
||||
|
||||
@@ -53,13 +53,13 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
const { t } = useI18n()
|
||||
|
||||
const statusDict = [
|
||||
{ value: 1, label: t('message.pages.miscprocurement.misc_stations.statusEnabled') },
|
||||
{ value: 0, label: t('message.pages.miscprocurement.misc_stations.statusDisabled') }
|
||||
{ value: 1, label: t('message.pages.miscprocurement.stationInfo.statusEnabled') },
|
||||
{ value: 0, label: t('message.pages.miscprocurement.stationInfo.statusDisabled') }
|
||||
]
|
||||
|
||||
const stationTypeDict = [
|
||||
{ value: 1, label: t('message.pages.miscprocurement.misc_stations.typeTooling') },
|
||||
{ value: 2, label: t('message.pages.miscprocurement.misc_stations.typeGraphite') }
|
||||
{ value: 1, label: t('message.pages.miscprocurement.stationInfo.typeTooling') },
|
||||
{ value: 2, label: t('message.pages.miscprocurement.stationInfo.typeGraphite') }
|
||||
]
|
||||
|
||||
void crudExpose
|
||||
@@ -79,7 +79,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
? list.find((item: any) => item.company_code === companyCode && item.stationcode === stationCode)
|
||||
: null
|
||||
if (exists && (!currentId || exists.id !== currentId)) {
|
||||
throw new Error(t('message.pages.miscprocurement.misc_stations.companyCode') + t('message.pages.miscprocurement.misc_stations.stationcode') + t('message.pages.menu.validation.alreadyExists'))
|
||||
throw new Error(t('message.pages.miscprocurement.stationInfo.companyCode') + t('message.pages.miscprocurement.stationInfo.stationcode') + t('message.pages.menu.validation.alreadyExists'))
|
||||
}
|
||||
}
|
||||
return {
|
||||
@@ -122,7 +122,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
},
|
||||
columns: {
|
||||
company_code: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.companyCode'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.companyCode'),
|
||||
type: 'dict-select',
|
||||
dict: dict({
|
||||
cache: false,
|
||||
@@ -134,60 +134,60 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
stationcode: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.stationcode'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.stationcode'),
|
||||
type: 'input',
|
||||
search: { show: true, component: { props: { placeholder: t('message.pages.miscprocurement.misc_stations.stationcode'), clearable: true } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_stations.stationcode') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
search: { show: true, component: { props: { placeholder: t('message.pages.miscprocurement.stationInfo.stationcode'), clearable: true } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.stationInfo.stationcode') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
editForm: {
|
||||
component: { props: { disabled: true } }
|
||||
},
|
||||
column: { minWidth: 140, showOverflowTooltip: true }
|
||||
},
|
||||
stationname: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.stationname'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.stationname'),
|
||||
type: 'input',
|
||||
search: { show: true, component: { props: { placeholder: t('message.pages.miscprocurement.misc_stations.stationname'), clearable: true } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_stations.stationname') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
search: { show: true, component: { props: { placeholder: t('message.pages.miscprocurement.stationInfo.stationname'), clearable: true } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.stationInfo.stationname') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { minWidth: 160, showOverflowTooltip: true }
|
||||
},
|
||||
stationtype: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.stationtype'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.stationtype'),
|
||||
type: 'dict-select',
|
||||
dict: dict({ data: stationTypeDict }),
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_stations.stationtype') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.stationInfo.stationtype') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { width: 140, showOverflowTooltip: true }
|
||||
},
|
||||
unit: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.unit'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.unit'),
|
||||
type: 'dict-select',
|
||||
dict: dict({
|
||||
cache: false,
|
||||
getData: async () => loadUnitOptions()
|
||||
}),
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_stations.unit') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.stationInfo.unit') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }] },
|
||||
column: { width: 140, showOverflowTooltip: true }
|
||||
},
|
||||
rate: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.rate'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.rate'),
|
||||
type: 'number',
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.misc_stations.rate') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }], component: { props: { precision: 2 } } },
|
||||
form: { rules: [{ required: true, message: t('message.pages.miscprocurement.stationInfo.rate') + ' ' + t('message.pages.menu.validation.fieldNameRequired') }], component: { props: { precision: 2 } } },
|
||||
column: { width: 120 }
|
||||
},
|
||||
status: {
|
||||
title: t('message.pages.miscprocurement.misc_stations.status'),
|
||||
title: t('message.pages.miscprocurement.stationInfo.status'),
|
||||
type: 'dict-switch',
|
||||
dict: dict({ data: statusDict }),
|
||||
form: { value: 1 },
|
||||
column: { width: 120 }
|
||||
},
|
||||
create_datetime: {
|
||||
title: '创建时间',
|
||||
title: t('message.pages.miscprocurement.stationInfo.createTime'),
|
||||
type: 'datetime',
|
||||
form: { show: false },
|
||||
column: { width: 180 }
|
||||
},
|
||||
update_datetime: {
|
||||
title: '更新时间',
|
||||
title: t('message.pages.miscprocurement.stationInfo.updateTime'),
|
||||
type: 'datetime',
|
||||
form: { show: false },
|
||||
column: { width: 180 }
|
||||
|
||||
Reference in New Issue
Block a user