feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -132,6 +132,18 @@
|
||||
<el-table-column label="备注" min-width="120">
|
||||
<template #default="{ row }"><el-input v-model="row.remark" placeholder="备注(可空)" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图纸/附件" width="190">
|
||||
<template #default="{ row }">
|
||||
<el-upload action="#" :show-file-list="false" multiple
|
||||
:http-request="(opt) => uploadStepAttachment(opt, row)">
|
||||
<el-button link type="primary" size="small">上传图纸</el-button>
|
||||
</el-upload>
|
||||
<div v-for="(a, ai) in (row.attachment || [])" :key="ai" style="font-size:12px;line-height:1.7">
|
||||
<el-link type="primary" @click="previewStepFile(a)">{{ a.name }}</el-link>
|
||||
<el-button link type="danger" size="small" @click="removeStepAttachment(row, ai)">删</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考核标准" width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="openCriteria(row)">
|
||||
@@ -252,6 +264,7 @@ function blankStep(seq) {
|
||||
isTorque: false,
|
||||
needCheck: false,
|
||||
remark: '',
|
||||
attachment: [],
|
||||
criteria: []
|
||||
}
|
||||
}
|
||||
@@ -317,6 +330,7 @@ function openFlow(row) {
|
||||
isTorque: !!s.isTorque,
|
||||
needCheck: !!s.needCheck,
|
||||
remark: s.remark || '',
|
||||
attachment: (s.attachment || []).map((a) => ({ ...a })),
|
||||
criteria: (s.criteria || []).map((c) => ({ ...c }))
|
||||
}))
|
||||
} else {
|
||||
@@ -337,6 +351,29 @@ function removeStep(row) {
|
||||
if (i >= 0) flowDlg.steps.splice(i, 1)
|
||||
}
|
||||
|
||||
/* ---------- 步骤图纸/附件(Item J:图纸绑定工艺步骤,按工序分发到工位终端)---------- */
|
||||
async function uploadStepAttachment(option, row) {
|
||||
const fd = new FormData()
|
||||
fd.append('file', option.file)
|
||||
try {
|
||||
const data = await request.post('/process-flows/upload', fd, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
if (!row.attachment) row.attachment = []
|
||||
row.attachment.push({ name: option.file.name, url: (data && data.url) || '' })
|
||||
if (option.onSuccess) option.onSuccess()
|
||||
ElMessage.success('图纸已上传')
|
||||
} catch (e) {
|
||||
if (option.onError) option.onError(e)
|
||||
}
|
||||
}
|
||||
function removeStepAttachment(row, i) {
|
||||
if (row.attachment) row.attachment.splice(i, 1)
|
||||
}
|
||||
function previewStepFile(a) {
|
||||
if (a && a.url) window.open(a.url, '_blank')
|
||||
}
|
||||
|
||||
/* ---------- 考核标准(单层弹窗) ---------- */
|
||||
const critDlg = reactive({ show: false, stepName: '', criteria: [], _step: null })
|
||||
|
||||
@@ -382,6 +419,7 @@ async function saveFlow() {
|
||||
isTorque: st.isTorque,
|
||||
needCheck: st.needCheck,
|
||||
remark: st.remark,
|
||||
attachment: st.attachment || [],
|
||||
criteria: st.criteria
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user