|
@@ -10,6 +10,23 @@
|
|
|
<el-form-item style="width: 200px">
|
|
|
<el-input placeholder="耳标" style="width: 200px" v-model="searchForm.earTag"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item style="width: 200px">
|
|
|
+ <el-input placeholder="疫苗名称" style="width: 200px" v-model="searchForm.vaccineName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="width: 140px">
|
|
|
+ <el-select
|
|
|
+ ref="slelctRef"
|
|
|
+ v-model="searchForm.manId"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="操作人">
|
|
|
+ <el-option
|
|
|
+ v-for="item in manList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button icon="el-icon-search" @click="init">查 询</el-button>
|
|
|
</el-form-item>
|
|
@@ -123,7 +140,7 @@
|
|
|
<!-- 弹框 -->
|
|
|
<el-dialog
|
|
|
:title="!dataForm.id ? '新增' : '修改'"
|
|
|
- :close-on-click-modal="false"
|
|
|
+ @close="onCancel"
|
|
|
:visible.sync="visible"
|
|
|
width="600px">
|
|
|
<el-form
|
|
@@ -149,7 +166,6 @@
|
|
|
<el-form-item label="操作人" prop="manId">
|
|
|
<el-select
|
|
|
ref="slelctRef"
|
|
|
- @change="onChangeMan($event)"
|
|
|
v-model="dataForm.manId"
|
|
|
style="width: 100%">
|
|
|
<el-option
|
|
@@ -184,7 +200,9 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
- earTag: ''
|
|
|
+ earTag: '',
|
|
|
+ vaccineName: '',
|
|
|
+ manId: ''
|
|
|
},
|
|
|
tableData: [],
|
|
|
dataListLoading: false,
|
|
@@ -207,7 +225,7 @@ export default {
|
|
|
{required: true, message: '疫苗名称不能为空', trigger: 'blur'}
|
|
|
],
|
|
|
manId: [
|
|
|
- {required: true, message: '操作人不能为空', trigger: 'change'}
|
|
|
+ {required: true, message: '操作人不能为空', trigger: 'blur'}
|
|
|
]
|
|
|
},
|
|
|
selectList: []
|
|
@@ -233,7 +251,9 @@ export default {
|
|
|
let params = {
|
|
|
page: this.page,
|
|
|
limit: this.limit,
|
|
|
- eartag: this.searchForm.earTag
|
|
|
+ eartag: this.searchForm.earTag || undefined,
|
|
|
+ vaccineName: this.searchForm.vaccineName || undefined,
|
|
|
+ manId: this.searchForm.manId || undefined
|
|
|
}
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl('/management/healthimmunerecord/list'),
|
|
@@ -257,13 +277,18 @@ export default {
|
|
|
},
|
|
|
// 修改
|
|
|
addOrUpdateHandle (row) {
|
|
|
- this.dataForm = {
|
|
|
- id: row.id,
|
|
|
- pigId: row.pigId,
|
|
|
- vaccineName: row.vaccineName,
|
|
|
- manId: row.manId
|
|
|
+ if (row) {
|
|
|
+ this.dataForm = {
|
|
|
+ id: row.id,
|
|
|
+ pigId: row.pigId,
|
|
|
+ vaccineName: row.vaccineName,
|
|
|
+ manId: row.manId
|
|
|
+ }
|
|
|
}
|
|
|
this.visible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
+ })
|
|
|
},
|
|
|
deleteHandle (id) {
|
|
|
let ids = [id]
|
|
@@ -290,6 +315,7 @@ export default {
|
|
|
},
|
|
|
onChangeMan (id) {
|
|
|
let man = {}
|
|
|
+ console.log(id);
|
|
|
man = this.manList.find(item => {
|
|
|
return item.id === id
|
|
|
})
|
|
@@ -318,6 +344,10 @@ export default {
|
|
|
duration: 1500
|
|
|
})
|
|
|
this.init()
|
|
|
+ if (this.dataForm.id) this.reset()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$message.error(data.msg)
|
|
|
}
|
|
@@ -327,6 +357,8 @@ export default {
|
|
|
},
|
|
|
clearAll () {
|
|
|
this.searchForm.earTag = ''
|
|
|
+ this.searchForm.vaccineName = ''
|
|
|
+ this.searchForm.manId = ''
|
|
|
},
|
|
|
delAll () {
|
|
|
let ids = this.selectList.map(pig => pig.id)
|
|
@@ -365,6 +397,9 @@ export default {
|
|
|
manId: '',
|
|
|
manName: ''
|
|
|
}
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -372,6 +407,7 @@ export default {
|
|
|
},
|
|
|
activated () {
|
|
|
this.init()
|
|
|
+ this.getManList()
|
|
|
}
|
|
|
}
|
|
|
</script>
|