From 7e67bae35f35db791762fca88e453d8a0e4922bc Mon Sep 17 00:00:00 2001 From: wangyu <823267011@qq.com> Date: Wed, 29 Apr 2026 14:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A7=E8=BE=8A=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MillProcessRecipeController.java | 3 +- ruoyi-ui/src/api/mill/plan.js | 14 +++--- ruoyi-ui/src/views/login.vue | 4 +- ruoyi-ui/src/views/mill/plan.vue | 47 +++++++++---------- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MillProcessRecipeController.java b/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MillProcessRecipeController.java index 633e850d..3ecffbb7 100644 --- a/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MillProcessRecipeController.java +++ b/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MillProcessRecipeController.java @@ -38,7 +38,8 @@ public class MillProcessRecipeController extends BaseController { @PostMapping public AjaxResult add(@RequestBody MillProcessRecipe recipe) { recipeService.save(recipe); - return AjaxResult.success(recipe.getId()); + return AjaxResult.success(recipe + .getRecipeId()); } @PutMapping diff --git a/ruoyi-ui/src/api/mill/plan.js b/ruoyi-ui/src/api/mill/plan.js index f87f92bc..f302b171 100644 --- a/ruoyi-ui/src/api/mill/plan.js +++ b/ruoyi-ui/src/api/mill/plan.js @@ -1,23 +1,23 @@ import request from '@/utils/request' export function listPlan(query) { - return request({ url: '/mill/plan/list', method: 'get', params: query }) + return request({ url: '/mill/production-plan/list', method: 'get', params: query }) } export function getPlan(id) { - return request({ url: `/mill/plan/${id}`, method: 'get' }) + return request({ url: `/mill/production-plan/${id}`, method: 'get' }) } export function addPlan(data) { - return request({ url: '/mill/plan', method: 'post', data }) + return request({ url: '/mill/production-plan', method: 'post', data }) } export function updatePlan(data) { - return request({ url: '/mill/plan', method: 'put', data }) + return request({ url: '/mill/production-plan', method: 'put', data }) } export function delPlan(id) { - return request({ url: `/mill/plan/${id}`, method: 'delete' }) + return request({ url: `/mill/production-plan/${id}`, method: 'delete' }) } export function moveUpPlan(id) { - return request({ url: `/mill/plan/moveUp/${id}`, method: 'put' }) + return request({ url: `/mill/production-plan/moveUp/${id}`, method: 'put' }) } export function moveDownPlan(id) { - return request({ url: `/mill/plan/moveDown/${id}`, method: 'put' }) + return request({ url: `/mill/production-plan/moveDown/${id}`, method: 'put' }) } diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 074ebb44..a5b2d6e4 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -73,8 +73,8 @@ export default { title: process.env.VUE_APP_TITLE, codeUrl: "", loginForm: { - username: "tony", - password: "123456", + username: "admin", + password: "admin123", rememberMe: false, code: "", uuid: "" diff --git a/ruoyi-ui/src/views/mill/plan.vue b/ruoyi-ui/src/views/mill/plan.vue index b6835314..7fa61f29 100644 --- a/ruoyi-ui/src/views/mill/plan.vue +++ b/ruoyi-ui/src/views/mill/plan.vue @@ -219,8 +219,8 @@ - + @@ -279,9 +279,9 @@ - + :value="r.recipeId" /> @@ -322,7 +322,7 @@ import { listPlan, addPlan, updatePlan, delPlan, moveUpPlan, moveDownPlan } from import { listAllRecipe, getRecipeDetail, addRecipe } from '@/api/mill/recipe' const emptyForm = () => ({ - id: null, inMatNo: '', alloyNo: '', recipeId: null, recipeNo: '', + planId: null, planNo: '', inMatNo: '', alloyNo: '', recipeId: null, recipeNo: '', outThick: '', inMatThick: '', inMatWidth: '', inMatLength: '', inMatWeight: '', inMatOd: '', inMatId: '', passCount: 0, remark: '' }) @@ -375,11 +375,11 @@ export default { }, computed: { planDialogTitle() { return this.isNew ? '新增钢卷' : '修改钢卷' }, - currentCoil() { return this.planList.find(p => p.prodStatus === '1') || {} }, + currentCoil() { return this.planList.find(p => p.prodStatus === 'Rolling') || {} }, nextCoil() { - const idx = this.planList.findIndex(p => p.prodStatus === '1') + const idx = this.planList.findIndex(p => p.prodStatus === 'Rolling') if (idx >= 0 && idx + 1 < this.planList.length) return this.planList[idx + 1] - return this.planList.find(p => p.prodStatus === '0') || {} + return this.planList.find(p => p.prodStatus === 'Idle') || {} } }, mounted() { @@ -392,10 +392,10 @@ export default { }, loadList() { const params = { inMatNo: this.query.inMatNo } - if (this.query.hideFinished) params.hideProdStatus = '2' + if (this.query.hideFinished) params.planStatus = '0' if (this.query.dateRange && this.query.dateRange.length === 2) { - params.beginDate = this.query.dateRange[0] - params.endDate = this.query.dateRange[1] + params.beginTime = this.query.dateRange[0] + params.endTime = this.query.dateRange[1] } listPlan(params).then(res => { this.planList = res.data || [] }) }, @@ -455,7 +455,7 @@ export default { return } // 创建隐藏方案(recipeNo 以 __ 开头表示私有,不展示在下拉列表中) - const autoNo = `__${this.selectedPlan.inMatNo || this.selectedPlan.id}` + const autoNo = `__${this.selectedPlan.inMatNo || this.selectedPlan.planId}` const payload = { recipeNo: autoNo, alloyNo: this.selectedPlan.alloyNo || '-', @@ -502,7 +502,6 @@ export default { _doSaveRecipeAndBindPlan(recipePayload) { return addRecipe(recipePayload).then(res => { const newId = res.data // controller 返回新 ID - const recipeNo = recipePayload.recipeNo.startsWith('__') ? '' : recipePayload.recipeNo return updatePlan({ ...this.selectedPlan, recipeId: newId, @@ -516,7 +515,7 @@ export default { this.loadList() // 刷新已选行数据 return listPlan({ inMatNo: this.selectedPlan.inMatNo }).then(res => { - const updated = (res.data || []).find(p => p.id === this.selectedPlan.id) + const updated = (res.data || []).find(p => p.planId === this.selectedPlan.planId) if (updated) { this.selectedPlan = updated getRecipeDetail(updated.recipeId).then(r => { @@ -537,7 +536,7 @@ export default { this.$message.warning('请选择一个方案') return } - const r = this.recipeOptions.find(x => x.id === this.selectRecipeId) + const r = this.recipeOptions.find(x => x.recipeId === this.selectRecipeId) updatePlan({ ...this.selectedPlan, recipeId: this.selectRecipeId, @@ -569,7 +568,7 @@ export default { this.$refs.formRef.validate(valid => { if (!valid) return if (this.form.recipeId) { - const r = this.recipeOptions.find(x => x.id === this.form.recipeId) + const r = this.recipeOptions.find(x => x.recipeId === this.form.recipeId) if (r) { this.form.recipeNo = r.recipeNo; this.form.passCount = r.passCount } } const api = this.isNew ? addPlan : updatePlan @@ -582,7 +581,7 @@ export default { }, handleDelete() { this.$confirm(`确定删除钢卷「${this.selectedPlan.inMatNo}」?`, '提示', { type: 'warning' }).then(() => { - delPlan(this.selectedPlan.id).then(() => { + delPlan(this.selectedPlan.planId).then(() => { this.$message.success('删除成功') this.selectedPlan = null this.passList = [] @@ -591,11 +590,11 @@ export default { }) }) }, - handleMoveUp() { moveUpPlan(this.selectedPlan.id).then(() => this.loadList()) }, - handleMoveDown() { moveDownPlan(this.selectedPlan.id).then(() => this.loadList()) }, + handleMoveUp() { moveUpPlan(this.selectedPlan.planId).then(() => this.loadList()) }, + handleMoveDown() { moveDownPlan(this.selectedPlan.planId).then(() => this.loadList()) }, onRecipeChange(recipeId) { if (!recipeId) return - const r = this.recipeOptions.find(x => x.id === recipeId) + const r = this.recipeOptions.find(x => x.recipeId === recipeId) if (r) { if (!this.form.alloyNo) this.form.alloyNo = r.alloyNo if (!this.form.inMatThick) this.form.inMatThick = r.inThick @@ -605,13 +604,13 @@ export default { }, queueRowClass({ row }) { - if (row.prodStatus === '1') return 'row-rolling' - if (row.prodStatus === '0' && this.currentCoil.sortNo && row.sortNo === this.currentCoil.sortNo + 1) return 'row-next' + if (row.prodStatus === 'Rolling') return 'row-rolling' + if (row.prodStatus === 'Idle' && this.currentCoil.sortNo && row.sortNo === this.currentCoil.sortNo + 1) return 'row-next' return '' }, passRowClass({ rowIndex }) { return rowIndex % 2 === 0 ? '' : 'alt-row' }, - prodStatusLabel(s) { return { '0': '待轧', '1': '轧制中', '2': '已完成', '9': '异常' }[s] || s }, - prodStatusClass(s) { return { '0': 'status-wait', '1': 'status-rolling', '2': 'status-done', '9': 'status-err' }[s] || '' } + prodStatusLabel(s) { return { Idle: '待轧', Rolling: '轧制中', NextCoil: '下一卷', Done: '已完成', Error: '异常' }[s] || s }, + prodStatusClass(s) { return { Idle: 'status-wait', Rolling: 'status-rolling', NextCoil: 'status-next', Done: 'status-done', Error: 'status-err' }[s] || '' } } }