机械化标准配置,新增配置时,无法输入,只能点选;添加完要么弹窗不关闭,要么增加数量录入

This commit is contained in:
BianLzhaoMin 2025-07-04 09:58:31 +08:00
parent a3a3958137
commit bb693e384a
1 changed files with 37 additions and 13 deletions

View File

@ -201,13 +201,34 @@
:props="{ value: 'typeId', label: 'typeName' }" :props="{ value: 'typeId', label: 'typeName' }"
@change="changeType" @change="changeType"
style="width: 100%" style="width: 100%"
clearable
filterable
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="规格型号" prop="typeModel"> <el-form-item label="规格型号" prop="typeModel">
<el-select v-model="form.typeModel" multiple placeholder="请选择规格型号" clearable style="width: 100%"> <el-select
v-model="form.typeModel"
multiple
placeholder="请选择规格型号"
clearable
style="width: 100%"
filterable
>
<el-option v-for="item in typeModelOptions" :key="item.typeId" :label="item.name" :value="item.typeId" /> <el-option v-for="item in typeModelOptions" :key="item.typeId" :label="item.name" :value="item.typeId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="num">
<el-input-number
v-model="form.num"
placeholder="请输入数量"
style="width: 100%"
:precision="0"
:step="10"
:min="0"
:max="9999"
/>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<template> <template>
@ -303,7 +324,8 @@ export default {
form: { form: {
configId: '', // id configId: '', // id
typeIds: [], // typeIds: [], //
typeModel: [] // typeModel: [], //
num: 0 //
}, },
formRules: { formRules: {
configId: [{ required: true, message: '请选择配置名称', trigger: 'change' }], configId: [{ required: true, message: '请选择配置名称', trigger: 'change' }],
@ -419,6 +441,7 @@ export default {
this.form.configId = this.form.configId || '' this.form.configId = this.form.configId || ''
this.form.typeIds = [] this.form.typeIds = []
this.form.typeModel = [] this.form.typeModel = []
this.form.num = 0
this.getConfigOpt() this.getConfigOpt()
this.getTypeOptions() this.getTypeOptions()
this.$nextTick(() => { this.$nextTick(() => {
@ -474,7 +497,8 @@ export default {
try { try {
const params = { const params = {
configId: this.form.configId, configId: this.form.configId,
typeIds: this.form.typeModel typeIds: this.form.typeModel,
num: this.form.num
} }
console.log('🚀 ~ 提交 params:', params) console.log('🚀 ~ 提交 params:', params)
addConfigDetails(params) addConfigDetails(params)
@ -520,17 +544,17 @@ export default {
}, },
/** 导出按钮作 */ /** 导出按钮作 */
handleExport() { handleExport() {
const formatTime = (date) => { const formatTime = date => {
const year = date.getFullYear(); const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0'); const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0'); const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0'); const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`; return `${year}${month}${day}_${hours}${minutes}${seconds}`
}; }
const currentTime = formatTime(new Date()); const currentTime = formatTime(new Date())
let queryTemp = this.queryParams let queryTemp = this.queryParams
this.download( this.download(
'/material/standardConfig/export', '/material/standardConfig/export',