Commit 74b1892b authored by jack_liu's avatar jack_liu

four

parent dc590608
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<div class="app-container" style="padding-top: 60px"> <div class="app-container" style="padding-top: 60px">
<div style="width: 60%; margin-left: 80px; padding-left: 8.6%"> <div style="width: 60%; margin-left: 80px; padding-left: 8.6%">
<el-form <el-form
:rules="rules"
ref="queryForm" ref="queryForm"
:model="queryParams" :model="queryParams"
:inline="true" :inline="true"
...@@ -11,14 +10,14 @@ ...@@ -11,14 +10,14 @@
<el-form-item style="flex-basis: 50%" prop="ptype"> <el-form-item style="flex-basis: 50%" prop="ptype">
<el-input <el-input
v-model.trim="queryParams.ptype" v-model.trim="queryParams.ptype"
placeholder="请输入工序" placeholder="请输入ptype"
clearable clearable
:maxlength="100" :maxlength="100"
size="small" size="small"
style="width: 350px" style="width: 350px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
> >
<template slot="prepend">工序</template></el-input <template slot="prepend">ptype</template></el-input
> >
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -99,9 +98,6 @@ export default { ...@@ -99,9 +98,6 @@ export default {
queryParams: { queryParams: {
ptype: '' ptype: ''
}, },
rules: {
ptype: [{ required: true, message: '请输入工序', trigger: 'blur' }]
}
} }
}, },
created() { created() {
...@@ -110,7 +106,7 @@ export default { ...@@ -110,7 +106,7 @@ export default {
methods: { methods: {
getDictList() { getDictList() {
getDictList({ getDictList({
dictLabel: this.queryParams.ptype dictType: this.queryParams.ptype
}).then(res => { }).then(res => {
this.dictList = res.data this.dictList = res.data
this.loading = false this.loading = false
...@@ -118,9 +114,14 @@ export default { ...@@ -118,9 +114,14 @@ export default {
}, },
//提交按钮 //提交按钮
onSubmit() { onSubmit() {
this.$refs.queryForm.validate(valid => {
if (valid) {
console.log(this.dictSelection) console.log(this.dictSelection)
if( this.queryParams.ptype === '' ){
this.$message.error('ptype为空,不允许提交')
return;
}
submit(this.dictSelection).then(res => { submit(this.dictSelection).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success('提交成功') this.$message.success('提交成功')
...@@ -128,10 +129,7 @@ export default { ...@@ -128,10 +129,7 @@ export default {
this.queryParams.ptype = '' this.queryParams.ptype = ''
} }
}) })
} else {
return false
}
})
}, },
//查询 //查询
handleQuery() { handleQuery() {
...@@ -185,15 +183,5 @@ export default { ...@@ -185,15 +183,5 @@ export default {
height: 12em; height: 12em;
width: 4px; width: 4px;
} }
.info {
height: 100px;
display: flex;
align-items: center;
justify-content: center;
.title {
color: #333;
font-weight: 700;
font-size: 16px;
}
}
</style> </style>
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