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
ref="queryForm" :rules="rules"
:model="queryParams" ref="queryForm"
:inline="true" :model="queryParams"
label-width="60px" :inline="true"
> label-width="60px"
>
<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,18 +18,19 @@ ...@@ -19,18 +18,19 @@
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
type="primary" type="primary"
size="small" size="small"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
>查询</el-button >查询</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
:gutter="40" :gutter="40"
v-loading="loading" v-loading="loading"
...@@ -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,18 +118,25 @@ export default { ...@@ -111,18 +118,25 @@ export default {
}, },
//提交按钮 //提交按钮
onSubmit() { onSubmit() {
console.log(this.dictSelection) this.$refs.queryForm.validate(valid => {
submit(this.dictSelection).then(res => { if (valid) {
if (res.code === 200) { console.log(this.dictSelection)
this.$message.success('提交成功') submit(this.dictSelection).then(res => {
this.$refs.dictTable.clearSelection() if (res.code === 200) {
this.queryParams.ptype = '' this.$message.success('提交成功')
this.$refs.dictTable.clearSelection()
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