Commit 4d659c21 authored by 高宇's avatar 高宇

1.在设备入库 位置后加个寿命 数据类型是正整数

parent 4c15678b
......@@ -71,6 +71,11 @@
<el-input v-model="form.plocation" placeholder="请输入位置" :style="{ width: '400px', height: '30px' }" :maxlength="100" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="寿命:" style="flex-basis: 50%;" prop="psm">
<el-input v-model="form.psm" placeholder="请输入寿命" :style="{ width: '400px', height: '30px' }" :maxlength="9" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form label-width="80px">
......@@ -104,7 +109,8 @@ export default {
phd: '',
flag: 1,
ptype: 1,
pstatus: 0
pstatus: 0,
psm: undefined
},
tableData: [], // 表格数据
selectedRows: [],
......@@ -125,6 +131,10 @@ export default {
{ required: true, message: '请输入位置', trigger: 'blur' },
{ pattern: /^[^[\uD800-\uDFFF]+$/, message: '不能包含表情符号', trigger: 'change' },
{ max: 100, message: '输入长度不能超过100个字符', trigger: 'change' }
],
psm: [
{ required: true, message: '请输入寿命', trigger: 'blur' },
{ pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' }
]
}
}
......@@ -161,7 +171,8 @@ export default {
phd: '',
flag: 1,
ptype: 1,
pstatus: 0
pstatus: 0,
psm: undefined
}
this.tableData = []
},
......@@ -298,7 +309,7 @@ export default {
lot: '',
plocation: '',
phd: '',
psm: '',
psm: undefined,
pzl: '',
prank: ''
}
......@@ -316,18 +327,16 @@ export default {
this.$message.warning('请先确定表格数据')
return
}
this.$refs.form.validate((valid) => {
if (valid) {
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// const newRow = {
// plocation
// }
this.$refs.form.validate((valid) => {
if (valid) {
console.log('form', this.form)
this.tableData.forEach(item => {
item.psm = this.form.psm
item.plocation = this.form.plocation
})
add(this.tableData).then(res => {
......@@ -336,17 +345,18 @@ export default {
this.$message.success('操作成功')
this.tableData = []
this.form.plocation = ''
this.form.psm = undefined
} else if (res.code === null) {
this.$message.error(res.message)
// this.tableData = []
// this.form.plocation = ''
}
})
})
} else {
// 校验失败,显示错误信息或进行其他操作
}
})
})
},
// 调数据字典查询
getDict() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment