feat: 实现产需单按工序步骤生成排产明细功能

1. 重构接收产需单接口,支持按配置工序步骤生成明细
2. 新增工艺、工艺步骤CRUD接口与管理页面
3. 新增工序选择组件
4. 优化产需单页面,增加历史记录功能
5. 为排产明细添加工序步骤名称展示
This commit is contained in:
2026-07-04 15:43:05 +08:00
parent ce09ac9da3
commit 2fde9ec993
12 changed files with 1529 additions and 427 deletions

View File

@@ -0,0 +1,112 @@
<template>
<div class="process-select">
<el-select
v-model="processId"
:placeholder="placeholder"
:clearable="clearable"
:disabled="disabled"
filterable
class="process-select-input"
@clear="handleClear"
>
<el-option
v-for="item in processList"
:key="item.processId"
:label="item.processName"
:value="item.processId"
>
<span class="process-option-name">{{ item.processName }}</span>
<span v-if="item._steps" class="process-option-steps">{{ item._steps }}</span>
</el-option>
</el-select>
</div>
</template>
<script>
import { listProcess } from '@/api/aps/process'
export default {
name: 'ProcessSelect',
props: {
value: {
type: [String, Number, undefined],
default: undefined
},
placeholder: {
type: String,
default: '请选择工序'
},
clearable: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
processList: []
}
},
computed: {
processId: {
get() {
return this.value
},
set(val) {
const process = this.processList.find(item => item.processId === val) || null
this.$emit('input', val)
this.$emit('change', val, process)
}
}
},
created() {
this.getProcessList()
},
methods: {
getProcessList() {
listProcess({ pageNum: 1, pageSize: 1000 }).then(res => {
const rows = res.rows || []
this.processList = rows.map(item => ({
...item,
_steps: (item.stepList && item.stepList.length > 0)
? item.stepList.map(s => s.stepName).join(' → ')
: ''
}))
}).catch(() => {
this.processList = []
})
},
handleClear() {
this.$emit('input', undefined)
this.$emit('change', undefined, null)
}
}
}
</script>
<style scoped lang="scss">
.process-select {
width: 100%;
}
.process-select-input {
width: 100%;
}
.process-option-name {
font-size: 14px;
font-weight: 500;
color: #303133;
}
.process-option-steps {
display: block;
margin-top: 4px;
font-size: 11px;
color: #909399;
line-height: 1.4;
}
</style>