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

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

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