feat(xumu): 新增免疫登记功能
- 添加免疫登记管理页面登记的新增、编辑和删除功能 - 集成耳标和相关组件 - 实现免疫号选择器组件 - 优化称重管理功能,修复相关问题
This commit is contained in:
80
project/xumu/components/AiEartagPicker.vue
Normal file
80
project/xumu/components/AiEartagPicker.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "AiEartagPicker",
|
||||
props: {
|
||||
instance: Function,
|
||||
value: {default: () => []},
|
||||
penId: {default: "", required: true}
|
||||
},
|
||||
model: {
|
||||
prop: "value",
|
||||
event: "input"
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
dialog: false,
|
||||
selected: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
penId: {
|
||||
immediate: true,
|
||||
handler(v) {
|
||||
this.getEartag(v)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getEartag(penId) {
|
||||
penId && this.instance.post("/api/breed/earTag/getEarTagByPenId", null, {
|
||||
params: {penId}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleConfirm() {
|
||||
this.dialog = false
|
||||
this.$emit("input", this.selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="AiEartagPicker">
|
||||
<el-select :value="value" clearable multiple placeholder="请选择">
|
||||
<el-option v-for="op in list" :key="op.id" :label="op.earTag" :value="op.id"/>
|
||||
<div slot="prefix" @click.stop="dialog=true"/>
|
||||
</el-select>
|
||||
<ai-dialog v-model="dialog" title="选择牲畜" width="640px" @confirm="handleConfirm" @closed="selected=[]" @open="selected=value">
|
||||
<el-transfer :data="list" v-model="selected" :titles="['可选','已选择']"/>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AiEartagPicker {
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-select) {
|
||||
width: 100%;
|
||||
|
||||
.el-input__inner {
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
|
||||
.el-input__prefix {
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 202412271101;
|
||||
|
||||
& > div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user