diff --git a/inventory-web/src/views/stock/inbound/buy.vue b/inventory-web/src/views/stock/inbound/buy.vue index 82058a1..bc61c67 100644 --- a/inventory-web/src/views/stock/inbound/buy.vue +++ b/inventory-web/src/views/stock/inbound/buy.vue @@ -471,7 +471,7 @@ - + - + + + + + + + @@ -389,8 +395,16 @@ - - + + + + + + + + + + @@ -628,7 +642,9 @@ const form = reactive({ warehouse_location: '', status: '在库', quality_status: '合格', bom_code: '', bom_version: '', work_order_code: '', order_id: '', production_manager: '', production_time_range: [] as string[], - raw_material_cost: 0, manual_cost: 0, sale_price: 0, + raw_material_cost: undefined as number | undefined, + manual_cost: undefined as number | undefined, + sale_price: undefined as number | undefined, quality_report_link: [] as string[], inspection_report_link: [] as string[], product_photo: [] as string[], detail_link: '' }) @@ -837,9 +853,9 @@ const handleUpdate = (row: any) => { quality_report_link: row.quality_report_link || [], inspection_report_link: row.inspection_report_link || [], in_quantity: Number(row.qty_inbound), - raw_material_cost: Number(row.raw_material_cost), - manual_cost: Number(row.manual_cost), - sale_price: Number(row.sale_price) + raw_material_cost: (row.raw_material_cost !== null && row.raw_material_cost !== undefined) ? Number(row.raw_material_cost) : undefined, + manual_cost: (row.manual_cost !== null && row.manual_cost !== undefined) ? Number(row.manual_cost) : undefined, + sale_price: (row.sale_price !== null && row.sale_price !== undefined) ? Number(row.sale_price) : undefined }) if(row.production_start_time && row.production_end_time) { form.production_time_range = [row.production_start_time, row.production_end_time] } else { form.production_time_range = [] } productPhotoList.value = form.product_photo.map(url => ({ name: url.split('/').pop(), url: getImageUrl(url) })) @@ -943,7 +959,16 @@ const submitForm = async () => { const iImages = iList.filter(item => !isExternalLink(item)) if (inspection_url.value && !iList.includes(inspection_url.value)) iImages.push(inspection_url.value) else if (inspection_url.value) iImages.push(inspection_url.value) - const payload = { ...form, quality_report_link: qImages, inspection_report_link: iImages, production_start_time: form.production_time_range?.[0], production_end_time: form.production_time_range?.[1] } + const payload = { + ...form, + quality_report_link: qImages, + inspection_report_link: iImages, + raw_material_cost: Number(form.raw_material_cost || 0), + manual_cost: Number(form.manual_cost || 0), + sale_price: Number(form.sale_price || 0), + production_start_time: form.production_time_range?.[0], + production_end_time: form.production_time_range?.[1] + } delete payload.production_time_range try { if(dialogStatus.value === 'create') { @@ -969,7 +994,7 @@ const handlePrint = async (row: any) => { const confirmPrint = async () => { printing.value = true; try { await executePrint(currentPrintData.value); ElMessage.success('已发送'); printVisible.value = false } catch (e: any) { ElMessage.error('打印失败') } finally { printing.value = false } } const resetForm = () => { materialOptions.value = []; bomOptions.value = []; productPhotoList.value = []; qualityFileList.value = []; inspectionFileList.value = []; quality_url.value = ''; inspection_url.value = '' - Object.assign(form, { id: undefined, base_id: undefined, material_name: '', spec_model: '', material_type: '', category: '', unit: '', sku: '', barcode: '', serial_number: '', in_date: '', in_quantity: 1, stock_quantity: 1, available_quantity: 1, warehouse_location: '', status: '在库', quality_status: '合格', bom_code: '', bom_version: '', work_order_code: '', order_id: '', production_manager: '', production_time_range: [], raw_material_cost: 0, manual_cost: 0, sale_price: 0, quality_report_link: [], inspection_report_link: [], product_photo: [], detail_link: '' }) + Object.assign(form, { id: undefined, base_id: undefined, material_name: '', spec_model: '', material_type: '', category: '', unit: '', sku: '', barcode: '', serial_number: '', in_date: '', in_quantity: 1, stock_quantity: 1, available_quantity: 1, warehouse_location: '', status: '在库', quality_status: '合格', bom_code: '', bom_version: '', work_order_code: '', order_id: '', production_manager: '', production_time_range: [], raw_material_cost: undefined, manual_cost: undefined, sale_price: undefined, quality_report_link: [], inspection_report_link: [], product_photo: [], detail_link: '' }) } const getStatusType = (s:string) => ({'在库':'success','出库':'info','借库':'warning','损耗':'danger'}[s]||'warning') const getQualityType = (s:string) => ({'合格':'success','不合格':'danger','待检':'info'}[s]||'info') @@ -1047,10 +1072,13 @@ onMounted(() => { /* [新增] 纯文本样式 */ .is-text-view :deep(.el-input__wrapper) { box-shadow: none !important; background-color: transparent !important; border-bottom: 1px dashed #dcdfe6; border-radius: 0; padding-left: 0; } .is-text-view :deep(.el-input__inner) { color: #303133; font-weight: 600; font-size: 14px; cursor: text; } + +/* 左对齐数字框 */ +:deep(.el-input-number .el-input__inner) { text-align: left; } + \ No newline at end of file diff --git a/inventory-web/src/views/stock/inbound/semi.vue b/inventory-web/src/views/stock/inbound/semi.vue index 2737500..d44227b 100644 --- a/inventory-web/src/views/stock/inbound/semi.vue +++ b/inventory-web/src/views/stock/inbound/semi.vue @@ -468,9 +468,21 @@
成本核算 (单件)
- - - + + + + + + + + + + + + + + + @@ -516,7 +528,7 @@