xxx
This commit is contained in:
@@ -120,6 +120,9 @@
|
||||
<t-button type="default" size="small" @click="exportCAD('brep')" title="导出BRep格式(FreeCAD原生)">
|
||||
导出 BRep
|
||||
</t-button>
|
||||
<t-button type="default" size="small" @click="createProductFromAnalysis" :loading="state.creatingProduct" title="将本次模具分析创建为进销存成品,可在进销存模块继续配置 BOM / 销售">
|
||||
📋 创建为成品
|
||||
</t-button>
|
||||
</div>
|
||||
|
||||
<div id="preview-3d" v-if="selectedHtmlFile" class="viewer-section viewer-section-hero">
|
||||
@@ -603,7 +606,8 @@ const state = reactive({
|
||||
surface_quality: 'standard',
|
||||
controller: 'fanuc',
|
||||
include_gcode: false
|
||||
}
|
||||
},
|
||||
creatingProduct: false
|
||||
})
|
||||
|
||||
const camSteelOptions = [
|
||||
@@ -644,6 +648,19 @@ const loadTask = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const createProductFromAnalysis = async () => {
|
||||
const taskId = route.params.taskId as string
|
||||
try {
|
||||
state.creatingProduct = true
|
||||
const product = await apiRequest<any>(`/api/products/from-task/${taskId}`, { method: 'POST' })
|
||||
addNotification(`已创建成品:${product.name}(SKU: ${product.sku})`, 'success')
|
||||
} catch (e) {
|
||||
handleApiError(e, '创建成品')
|
||||
} finally {
|
||||
state.creatingProduct = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!appStore.user) {
|
||||
router.push('/login')
|
||||
|
||||
Reference in New Issue
Block a user