Commit dc590608 authored by jack_liu's avatar jack_liu

three

parent 2b7b65a6
<template> <template>
<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,7 +10,7 @@ ...@@ -11,7 +10,7 @@
> >
<el-form-item style="flex-basis: 50%" prop="ptype"> <el-form-item style="flex-basis: 50%" prop="ptype">
<el-input <el-input
v-model="queryParams.ptype" v-model.trim="queryParams.ptype"
placeholder="请输入工序" placeholder="请输入工序"
clearable clearable
:maxlength="100" :maxlength="100"
...@@ -19,7 +18,8 @@ ...@@ -19,7 +18,8 @@
style="width: 350px" style="width: 350px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
> >
<template slot="prepend">工序</template></el-input> <template slot="prepend">工序</template></el-input
>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
...@@ -72,7 +72,11 @@ ...@@ -72,7 +72,11 @@
<el-row style="padding-left: 8.6%; padding-top: 1%"> <el-row style="padding-left: 8.6%; padding-top: 1%">
<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="onSubmit">提交</el-button> <el-button
type="primary"
@click="onSubmit"
>提交</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -94,6 +98,9 @@ export default { ...@@ -94,6 +98,9 @@ export default {
dictSelection: [], dictSelection: [],
queryParams: { queryParams: {
ptype: '' ptype: ''
},
rules: {
ptype: [{ required: true, message: '请输入工序', trigger: 'blur' }]
} }
} }
}, },
...@@ -111,6 +118,8 @@ export default { ...@@ -111,6 +118,8 @@ export default {
}, },
//提交按钮 //提交按钮
onSubmit() { onSubmit() {
this.$refs.queryForm.validate(valid => {
if (valid) {
console.log(this.dictSelection) console.log(this.dictSelection)
submit(this.dictSelection).then(res => { submit(this.dictSelection).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -119,10 +128,15 @@ export default { ...@@ -119,10 +128,15 @@ export default {
this.queryParams.ptype = '' this.queryParams.ptype = ''
} }
}) })
} else {
return false
}
})
}, },
//查询 //查询
handleQuery() { handleQuery() {
this.$refs.dictTable.clearSelection() //清空
/* this.$refs.dictTable.clearSelection() */
if (this.queryParams.ptype == '') { if (this.queryParams.ptype == '') {
return return
} }
......
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