feat(xumu): 添加远程耳标号查询功能
- 在 AppDeathManage 和 AppOutManage 组件中集成 AiEartagRemote 组件 - 实现耳标号远程查询和自动填充功能 -优化用户输入体验,提高数据准确性
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import {mapState} from "vuex"
|
||||
import AiEartagRemote from "@project/xumu/components/AiEartagRemote.vue";
|
||||
|
||||
const formImages = [
|
||||
{label: "身长测量照片", prop: "heightPic", rules: {required: true, message: '请上传 身长测量照片'}},
|
||||
@@ -9,6 +10,7 @@ const formImages = [
|
||||
]
|
||||
export default {
|
||||
name: "deathAdd",
|
||||
components: {AiEartagRemote},
|
||||
props: {
|
||||
instance: Function,
|
||||
permissions: Function,
|
||||
@@ -71,7 +73,10 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
handlerAutocomplete(value) {
|
||||
'biochipEarNumber|farmId|houseId|penId|electronicEarNumber|originalEarNumber|category|variety'.split("|").forEach(prop => this.$set(this.detail, prop, value[prop]))
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getDetail(this.$route.query.id)
|
||||
@@ -84,7 +89,7 @@ export default {
|
||||
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||
<ai-card title="基础信息">
|
||||
<div class="grid c-4">
|
||||
<ai-input class="row" v-model="detail.biochipEarNumber" placeholder="请输入耳标号按回车查询,或扫描耳标号" @input="getDetail"/>
|
||||
<ai-eartag-remote :instance="instance" @enter="handlerAutocomplete" />
|
||||
<el-form-item label="生物芯片耳标号">
|
||||
<b v-text="detail.biochipEarNumber"/>
|
||||
</el-form-item>
|
||||
@@ -100,7 +105,7 @@ export default {
|
||||
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||
<b v-text="detail.electronicEarNumber"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="原厂耳标号" prop="category">
|
||||
<el-form-item label="原厂耳标号" prop="originalEarNumber">
|
||||
<b v-text="detail.originalEarNumber"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="category">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import { mapState } from "vuex"
|
||||
import AiEartagRemote from "@project/xumu/components/AiEartagRemote.vue";
|
||||
|
||||
const formImages = [
|
||||
{ label: "身长测量照片", prop: "heightPic", rules: { required: true, message: '请上传 身长测量照片' } },
|
||||
@@ -9,6 +10,7 @@ const formImages = [
|
||||
]
|
||||
export default {
|
||||
name: "outAdd",
|
||||
components: {AiEartagRemote},
|
||||
props: {
|
||||
instance: Function,
|
||||
permissions: Function,
|
||||
@@ -72,7 +74,10 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
handlerAutocomplete(value) {
|
||||
'biochipEarNumber|farmId|houseId|penId|electronicEarNumber|originalEarNumber|category|variety'.split("|").forEach(prop => this.$set(this.detail, prop, value[prop]))
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.dict.load("yesOrNo", "category", "variety", "outReason")
|
||||
@@ -86,7 +91,7 @@ export default {
|
||||
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||
<ai-card title="基础信息">
|
||||
<div class="grid c-4">
|
||||
<ai-input class="row" v-model="filter" placeholder="请输入耳标号按回车查询,或扫描耳标号" @keyup.enter.native="getDetail(filter)"/>
|
||||
<ai-eartag-remote :instance="instance" @enter="handlerAutocomplete" />
|
||||
<el-form-item label="生物芯片耳标号">
|
||||
<b v-text="detail.biochipEarNumber" />
|
||||
</el-form-item>
|
||||
@@ -102,7 +107,7 @@ export default {
|
||||
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||
<b v-text="detail.electronicEarNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原厂耳标号" prop="category">
|
||||
<el-form-item label="原厂耳标号" prop="originalEarNumber">
|
||||
<b v-text="detail.originalEarNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="category">
|
||||
@@ -139,7 +144,8 @@ export default {
|
||||
<ai-card title="审批信息" v-if="isAuthing">
|
||||
<el-form :model="form" size="small" ref="form" label-width="120px">
|
||||
<el-form-item label="是否同意" prop="auditStatus" :rules="[{ required: true, message: '请选择是否同意' }]">
|
||||
<ai-select v-model="form.auditStatus" :select-list="[{dictValue: 2, dictName: '同意'}, {dictValue: 3, dictName: '不同意'}]"/>
|
||||
<ai-select v-model="form.auditStatus"
|
||||
:select-list="[{ dictValue: 2, dictName: '同意' }, { dictValue: 3, dictName: '不同意' }]" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见" prop="auditReason">
|
||||
<el-input type="textarea" :row="3" v-model="form.auditReason" clearable placeholder="请输入" />
|
||||
|
||||
40
project/xumu/components/AiEartagRemote.vue
Normal file
40
project/xumu/components/AiEartagRemote.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "AiEartagRemote",
|
||||
props: {
|
||||
instance: Function
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getText(biochipEarNumber) {
|
||||
this.info = {}
|
||||
return this.instance.post("/api/breed/earTag/page", null, { params: { biochipEarNumber } }).then(res => {
|
||||
if (res?.data) {
|
||||
this.info = res.data
|
||||
this.$emit('enter', this.info)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="AiEartagRemote">
|
||||
<ai-input v-model="value" placeholder="请输入耳标号按回车查询,或扫描耳标号" @keyup.enter.native="getText(value)" />
|
||||
</section>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AiEartagRemote {
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user