改备注,改耳号,改品种,转场部分模糊查询+多耳号输入
This commit is contained in:
@@ -6,9 +6,16 @@
|
||||
<el-date-picker v-model="transitionDateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理耳号" prop="manageTags">
|
||||
<el-input v-model="queryParams.manageTags" placeholder="请输入管理耳号" clearable @keyup.enter="handleQuery"
|
||||
style="width: 150px;" />
|
||||
<el-form-item label="管理耳号" prop="manageTagsList">
|
||||
<el-select v-model="queryParams.manageTagsList" multiple filterable remote reserve-keyword
|
||||
placeholder="请输入耳号,支持多选" :remote-method="searchEarNumber" :loading="earLoading" allow-create
|
||||
default-first-option style="width: 260px">
|
||||
<el-option v-for="item in earOptions" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
<el-button type="text" @click="clearEarNumbers"
|
||||
v-if="queryParams.manageTagsList && queryParams.manageTagsList.length > 0" style="margin-left: 8px">
|
||||
清空
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="品种" prop="varietyId">
|
||||
<el-select v-model="queryParams.varietyId" placeholder="请选择品种" style="min-width:150px" clearable>
|
||||
@@ -42,7 +49,13 @@
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div v-if="queryParams.manageTagsList && queryParams.manageTagsList.length > 0" class="selected-ear-numbers">
|
||||
<span style="margin-right: 10px; color: #606266;">已选耳号:</span>
|
||||
<el-tag v-for="tag in queryParams.manageTagsList" :key="tag" closable @close="removeEarNumber(tag)"
|
||||
style="margin-right: 8px;">
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<!-- 按钮行 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
@@ -222,7 +235,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Transition_info">
|
||||
import { listTransition_info, getTransition_info, delTransition_info, addTransition_info, getSheepByRanchId, updateTransition_info, listRanch, approveTransitionInfo } from "@/api/produce/manage_sheep/transition_info"
|
||||
import { listTransition_info, getTransition_info, delTransition_info, addTransition_info, getSheepByRanchId, updateTransition_info, listRanch, approveTransitionInfo,searchEarNumbers } from "@/api/produce/manage_sheep/transition_info"
|
||||
import { checkSheepByManageTags, getSheepBySheepfoldId } from '@/api/produce/other/fixHoof'
|
||||
import request from '@/utils/request'
|
||||
|
||||
@@ -298,7 +311,8 @@ const data = reactive({
|
||||
}
|
||||
})
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
const earOptions = ref([])
|
||||
const earLoading = ref(false)
|
||||
//获取转场记录列表
|
||||
function getList() {
|
||||
loading.value = true
|
||||
@@ -379,7 +393,7 @@ function loadSheepfoldsByRanch(ranchName) {
|
||||
url: '/sheepfold_management/sheepfold_management/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
ranchId: ranchId,
|
||||
ranchId: ranchId,
|
||||
pageNum: 1,
|
||||
pageSize: 999
|
||||
}
|
||||
@@ -596,6 +610,7 @@ function handleQuery() {
|
||||
function resetQuery() {
|
||||
queryParams.value.transType = null;
|
||||
transitionDateRange.value = [];
|
||||
queryParams.value.manageTagsList = []
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
@@ -721,7 +736,20 @@ function handleDelete(row) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function searchEarNumber(query) {
|
||||
if (!query) { earOptions.value = []; return }
|
||||
earLoading.value = true
|
||||
searchEarNumbers(query.trim()).then(res => {
|
||||
earOptions.value = res.data || []
|
||||
}).finally(() => earLoading.value = false)
|
||||
}
|
||||
function clearEarNumbers() {
|
||||
queryParams.value.manageTagsList = []
|
||||
}
|
||||
function removeEarNumber(tag) {
|
||||
const idx = queryParams.value.manageTagsList.indexOf(tag)
|
||||
if (idx > -1) queryParams.value.manageTagsList.splice(idx, 1)
|
||||
}
|
||||
onMounted(() => {
|
||||
loadRanchOptions();
|
||||
getVarietyOptions();
|
||||
@@ -738,4 +766,11 @@ onMounted(() => {
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.selected-ear-numbers {
|
||||
margin-bottom: 16px;
|
||||
padding: 10px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user