feat: migrate process execution module
Some checks failed
Release pipeline / publish (push) Has been cancelled
Release pipeline / Always run job (push) Has been cancelled

- add V2 process execution page for planning production monitoring

- add process execution API, route, and i18n entries

- update migration task list status for process execution
This commit is contained in:
sheng
2026-06-22 15:07:38 +08:00
parent 45c2ea6e63
commit 8ef087676f
6 changed files with 318 additions and 3 deletions

View File

@@ -3,8 +3,8 @@
> 根据 `后台Webman界面截图对照表.md` 生成。状态以当前 V2 项目中已落地的页面目录为准。
- 总功能数79
- 已迁移21
- 未迁移58
- 已迁移22
- 未迁移57
| 状态 | 一级模块 | 二级模块 | 三级模块 | 功能说明 | V2 目标路径 |
|:---:|---|---|---|---|---|
@@ -52,7 +52,7 @@
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 托盘管理 (Tray Management) | 托盘管理 | `src/views/planning-production/production-monitoring/tray-management/` |
| ⬜ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 托盘登录 (Tray Registration) | 托盘登记 | 待确认 |
| ⬜ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 设备监控 (Equipment Monitoring) | 设备监控 | 待确认 |
| | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 电池工序管理 (Process Execution) | 工序管理 | 待确认 |
| | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 电池工序管理 (Process Execution) | 工序管理 | `src/views/planning-production/production-monitoring/process-execution/` |
| ⬜ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 检验类别管理 (Inspection Type Management) | | 待确认 |
| ⬜ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检项目配置 (First Article Inspection Configuration) | | 待确认 |
| ⬜ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检录入 (First Article Inspection Records) | | 待确认 |

View File

@@ -0,0 +1,27 @@
import { request } from '@/api/_service'
const BASE = 'planning_production/produce/change_battery_process/'
function apiParams (method, data = {}) {
return {
method,
platform: 'background',
...data
}
}
export function verifyBatteryProcessInfo (data) {
return request({
url: BASE + 'verify',
method: 'get',
params: apiParams('planning_production_produce_change_battery_process_verify', data)
})
}
export function changeBatteryProcess (data) {
return request({
url: BASE + 'change',
method: 'get',
params: apiParams('planning_production_produce_change_battery_process_change', data)
})
}

View File

@@ -963,6 +963,36 @@
"grade": "Grade",
"activation_status": "Activation Status",
"channel_battery_info": "Channel {index} Battery Info"
},
"process_execution": {
"query": "Search",
"reset": "Reset",
"add": "Add",
"delete": "Delete",
"edit": "Edit",
"confirm": "Confirm",
"cancel": "Cancel",
"prompt": "Notice",
"battery_id": "Battery Barcode",
"enter_battery_id": "Enter battery barcode",
"select_process_to_change": "Select target process",
"please_select_process": "Please select a process",
"clear_class_sign": "Clear grade marker?",
"yes": "Yes",
"no": "No",
"verify_data": "Verify Data",
"change_process": "Change Process",
"multi_battery_input": "Multi-Battery Input",
"input_rule": "Rule: One barcode per line",
"please_enter_battery_id_data": "Enter battery barcode data",
"sort": "No.",
"batch": "Batch",
"tray": "Tray",
"lot": "No.",
"class_type": "Grade Type",
"class": "Grade",
"previous_process": "Previous Process",
"current_process": "Current Process"
}
}
}

View File

@@ -963,6 +963,36 @@
"grade": "等级",
"activation_status": "激活状态",
"channel_battery_info": "通道 {index} 电池信息"
},
"process_execution": {
"query": "查询",
"reset": "重置",
"add": "新增",
"delete": "删除",
"edit": "编辑",
"confirm": "确定",
"cancel": "取消",
"prompt": "提示",
"battery_id": "电池条码",
"enter_battery_id": "请输入电池条码",
"select_process_to_change": "选择更改的工序",
"please_select_process": "请选择更改的工序",
"clear_class_sign": "是否清除档位标记",
"yes": "是",
"no": "否",
"verify_data": "验证数据",
"change_process": "更改工序",
"multi_battery_input": "多电池条码输入",
"input_rule": "输入规则:每个电池条码占一行输入",
"please_enter_battery_id_data": "请输入电池条码数据",
"sort": "序号",
"batch": "批次",
"tray": "托盘",
"lot": "流水号",
"class_type": "档位类型",
"class": "档位",
"previous_process": "上一工序",
"current_process": "当前工序"
}
}
}

View File

@@ -37,6 +37,12 @@ export default {
name: `${pre}monitor-tray_manage`,
meta: { ...meta, cache: true, title: '托盘管理' },
component: _import('planning-production/production-monitoring/tray-management')
},
{
path: 'produce/monitor/change_battery_process',
name: `${pre}monitor-change_battery_process`,
meta: { ...meta, cache: true, title: '电池工序管理' },
component: _import('planning-production/production-monitoring/process-execution')
}
])('planning_production-')
}

View File

@@ -0,0 +1,222 @@
<template>
<d2-container>
<template #header>
<div class="search-bar">
<el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item :label="$t(key('battery_id'))" prop="battery_ids">
<el-input
v-model="form.battery_ids"
:placeholder="$t(key('enter_battery_id'))"
class="battery-input"
clearable
>
<el-button slot="append" icon="el-icon-document-add" @click="openBatchInput" />
</el-input>
</el-form-item>
<el-form-item
v-show="showProcess"
:label="$t(key('select_process_to_change'))"
prop="next_process_code"
>
<el-select
v-model="form.next_process_code"
filterable
clearable
:placeholder="$t(key('please_select_process'))"
style="width:220px"
@change="syncProcessOptions"
>
<el-option
v-for="item in processOptions"
:key="item.id || item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t(key('clear_class_sign'))" prop="classname_sign">
<el-radio v-model="form.classname_sign" label="1">{{ $t(key('yes')) }}</el-radio>
<el-radio v-model="form.classname_sign" label="2">{{ $t(key('no')) }}</el-radio>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
:disabled="loading"
:loading="loading"
@click="verifyData"
>
{{ $t(key('verify_data')) }}
</el-button>
<el-button icon="el-icon-refresh" :disabled="loading" @click="resetForm">
{{ $t(key('reset')) }}
</el-button>
<el-button type="warning" :disabled="loading" @click="changeProcess">
{{ $t(key('change_process')) }}
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<page-table
:columns="columns"
:data="tableData"
:loading="loading"
:toolbar-buttons="[]"
:row-buttons="[]"
:pagination="null"
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
auto-height
@selection-change="onSelectionChange"
>
<template #empty>
<el-empty :description="$t('暂无数据')" :image-size="80" />
</template>
</page-table>
<el-dialog :title="$t(key('multi_battery_input'))" :visible.sync="dialogVisible" width="520px">
<el-form>
<el-form-item :label="$t(key('input_rule'))">
<el-input v-model="dialogBatteryIds" type="textarea" :rows="8" />
</el-form-item>
</el-form>
<span slot="footer">
<el-button size="mini" @click="dialogVisible = false">{{ $t(key('cancel')) }}</el-button>
<el-button size="mini" type="primary" @click="confirmBatchInput">{{ $t(key('confirm')) }}</el-button>
</span>
</el-dialog>
</d2-container>
</template>
<script>
import { useTableColumns } from '@/composables/useTableColumns'
import { i18nMixin } from '@/composables/useI18n'
import PageTable from '@/components/page-table'
import {
verifyBatteryProcessInfo,
changeBatteryProcess
} from '@/api/planning-production/process-execution'
export default {
name: 'planning-production-process-execution',
components: { PageTable },
mixins: [i18nMixin('page.planning_production.production_monitoring.process_execution')],
data () {
return {
loading: false,
showProcess: false,
form: {
battery_ids: '',
classname_sign: '2',
next_process_code: '',
processOptions: []
},
processOptions: [],
tableData: [],
selectedRows: [],
dialogVisible: false,
dialogBatteryIds: ''
}
},
computed: {
columns () {
return useTableColumns([
{ prop: 'battery_id', label: this.key('battery_id'), minWidth: 180 },
{ prop: 'batch', label: this.key('batch'), minWidth: 150, showOverflowTooltip: true },
{ prop: 'tray', label: this.key('tray'), minWidth: 100, showOverflowTooltip: true },
{ prop: 'lot', label: this.key('lot'), minWidth: 80, showOverflowTooltip: true },
{ prop: 'class', label: this.key('class_type'), minWidth: 80, showOverflowTooltip: true },
{ prop: 'classname', label: this.key('class'), minWidth: 80, showOverflowTooltip: true },
{ prop: 'process_code', label: this.key('previous_process'), minWidth: 180 },
{ prop: 'next_process_code', label: this.key('current_process'), minWidth: 180, showOverflowTooltip: true }
], {
selectionWidth: 55,
indexWidth: 55
}).map(col => {
if (col.type === 'index') col.label = this.key('sort')
return col
})
}
},
methods: {
ensureBatteryInput () {
if (this.form.battery_ids) return true
this.$message.warning(this.$t(this.key('please_enter_battery_id_data')))
return false
},
openBatchInput () {
this.form.battery_ids = ''
this.dialogBatteryIds = ''
this.showProcess = false
this.processOptions = []
this.dialogVisible = true
},
confirmBatchInput () {
const value = this.dialogBatteryIds
.trim()
.split('\n')
.map(item => item.trim())
.filter(Boolean)
.join(',')
this.form.battery_ids = value
this.dialogVisible = false
},
syncProcessOptions () {
this.form.processOptions = this.processOptions
},
verifyData () {
if (!this.ensureBatteryInput()) return
this.loading = true
verifyBatteryProcessInfo(this.form)
.then(res => {
const data = res && res.data ? res.data : res
this.processOptions = data.flow_process || []
this.form.processOptions = this.processOptions
this.tableData = data.data || []
this.showProcess = true
})
.finally(() => {
this.loading = false
})
},
changeProcess () {
if (!this.ensureBatteryInput()) return
if (!this.form.next_process_code) {
this.$message.warning(this.$t(this.key('please_select_process')))
return
}
this.loading = true
changeBatteryProcess(this.form)
.then(res => {
const data = res && res.data ? res.data : res
this.tableData = Array.isArray(data) ? data : (data.data || [])
})
.finally(() => {
this.loading = false
})
},
resetForm () {
this.$refs.form.resetFields()
this.showProcess = false
this.processOptions = []
this.tableData = []
},
onSelectionChange (rows) {
this.selectedRows = rows
}
}
}
</script>
<style scoped>
.search-bar {
margin-bottom: -18px;
}
.battery-input {
width: 360px;
}
</style>