新增三级钢卷数据查询配置
This commit is contained in:
@@ -209,7 +209,13 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="钢卷编号" prop="inMatNo">
|
||||
<el-input v-model="form.inMatNo" :disabled="!isNew" />
|
||||
<el-input v-model="form.inMatNo" :disabled="!isNew"
|
||||
@keyup.enter.native="isNew && queryKlpCoil()"
|
||||
@blur="isNew && queryKlpCoil()"
|
||||
placeholder="回车从三级查询钢卷数据">
|
||||
<el-button slot="append" icon="el-icon-search"
|
||||
:loading="coilQuerying" @click="queryKlpCoil" v-if="isNew" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -323,6 +329,8 @@
|
||||
<script>
|
||||
import { listPlan, addPlan, updatePlan, delPlan, moveUpPlan, moveDownPlan, finishPlan } from '@/api/mill/plan'
|
||||
import { listAllRecipe, getRecipeDetail, addRecipe } from '@/api/mill/recipe'
|
||||
import request from '@/utils/request'
|
||||
const queryKlpCoilByNo = (coilNo) => request({ url: '/mill/klpCoil/queryByCoilNo', method: 'get', params: { coilNo } })
|
||||
|
||||
const emptyForm = () => ({
|
||||
planId: null, planNo: '', inMatNo: '', alloyNo: '', recipeId: null, recipeNo: '',
|
||||
@@ -366,6 +374,7 @@ export default {
|
||||
// 选择方案对话框
|
||||
selectRecipeVisible: false,
|
||||
selectRecipeId: null,
|
||||
coilQuerying: false,
|
||||
|
||||
// 保存为方案对话框
|
||||
saveAsRecipeVisible: false,
|
||||
@@ -568,6 +577,24 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
// ── 从三级 WMS 查询钢卷数据 ──
|
||||
queryKlpCoil() {
|
||||
const coilNo = (this.form.inMatNo || '').trim()
|
||||
if (!coilNo) return
|
||||
this.coilQuerying = true
|
||||
queryKlpCoilByNo(coilNo).then(res => {
|
||||
const c = res && res.data
|
||||
if (!c) { this.$message.info('三级 WMS 中未找到该钢卷号'); return }
|
||||
if (c.actualThickness && !this.form.inMatThick) this.form.inMatThick = c.actualThickness
|
||||
if (c.actualWidth && !this.form.inMatWidth) this.form.inMatWidth = String(c.actualWidth)
|
||||
if (c.netWeight && !this.form.inMatWeight) this.form.inMatWeight = String(c.netWeight)
|
||||
if (c.length && !this.form.inMatLength) this.form.inMatLength = String(c.length)
|
||||
this.$message.success('已从三级 WMS 自动填入钢卷数据')
|
||||
}).catch(() => {
|
||||
this.$message.warning('三级 WMS 查询失败,请手动填写')
|
||||
}).finally(() => { this.coilQuerying = false })
|
||||
},
|
||||
|
||||
// ── 钢卷 CRUD ──
|
||||
handleAdd() {
|
||||
this.isNew = true
|
||||
|
||||
Reference in New Issue
Block a user