Merge branch 'main' of http://118.182.97.76:3000/admin/zhyc-sheep-ui
This commit is contained in:
@@ -196,6 +196,21 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="母羊耳号" align="center" prop="femaleEarNumber" width="120" fixed="left" />
|
<el-table-column label="母羊耳号" align="center" prop="femaleEarNumber" width="120" fixed="left" />
|
||||||
<el-table-column label="母羊品种" align="center" prop="femaleBreed" width="100" />
|
<el-table-column label="母羊品种" align="center" prop="femaleBreed" width="100" />
|
||||||
|
<el-table-column label="事件类型" align="center" width="90">
|
||||||
|
<template #default>
|
||||||
|
<el-tag type="success" size="small">产羔</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产羔日期" align="center" prop="createTime" width="110">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="配种类型" align="center" prop="breedType" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ getBreedTypeLabel(scope.row.breedType) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="配种日期" align="center" prop="breedingDate" width="110">
|
<el-table-column label="配种日期" align="center" prop="breedingDate" width="110">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.breedingDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.breedingDate, '{y}-{m}-{d}') }}</span>
|
||||||
@@ -204,6 +219,12 @@
|
|||||||
<el-table-column label="胎次" align="center" prop="parity" width="80" />
|
<el-table-column label="胎次" align="center" prop="parity" width="80" />
|
||||||
<el-table-column label="公羊耳号" align="center" prop="maleEarNumber" width="120" />
|
<el-table-column label="公羊耳号" align="center" prop="maleEarNumber" width="120" />
|
||||||
<el-table-column label="公羊品种" align="center" prop="maleBreed" width="120" />
|
<el-table-column label="公羊品种" align="center" prop="maleBreed" width="120" />
|
||||||
|
<!-- 供体信息(胚胎移植时有值) -->
|
||||||
|
<el-table-column label="供体母羊" align="center" prop="donorEwe" width="120" />
|
||||||
|
<el-table-column label="供体母羊品种" align="center" prop="donorEweBreed" width="120" />
|
||||||
|
<el-table-column label="供体公羊" align="center" prop="donorRam" width="120" />
|
||||||
|
<el-table-column label="供体公羊品种" align="center" prop="donorRamBreed" width="120" />
|
||||||
|
<el-table-column label="移胚数" align="center" prop="embryoCount" width="90" />
|
||||||
<el-table-column label="产羔数量" align="center" prop="lambsBorn" width="90" />
|
<el-table-column label="产羔数量" align="center" prop="lambsBorn" width="90" />
|
||||||
<el-table-column label="活羔数量" align="center" prop="survival" width="90" />
|
<el-table-column label="活羔数量" align="center" prop="survival" width="90" />
|
||||||
<el-table-column label="折损数" align="center" prop="loss" width="80">
|
<el-table-column label="折损数" align="center" prop="loss" width="80">
|
||||||
@@ -211,6 +232,23 @@
|
|||||||
<span>{{ (scope.row.lambsBorn || 0) - (scope.row.survival || 0) }}</span>
|
<span>{{ (scope.row.lambsBorn || 0) - (scope.row.survival || 0) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="羔羊品种" align="center" prop="lambBreedId" width="110">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ getVarietyName(scope.row.lambBreedId) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template v-for="n in 8" :key="'lambcols'+n">
|
||||||
|
<el-table-column :label="'羔羊耳号'+n" align="center" width="130">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.lambDetails && scope.row.lambDetails[n-1] ? scope.row.lambDetails[n-1].lambEarNumber : '' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="'羔羊'+n+'出生重'" align="center" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.lambDetails && scope.row.lambDetails[n-1] ? scope.row.lambDetails[n-1].birthWeight : '' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
<el-table-column label="技术员" align="center" prop="technician" width="100" />
|
<el-table-column label="技术员" align="center" prop="technician" width="100" />
|
||||||
<el-table-column label="月龄" align="center" prop="monthAge" width="80" />
|
<el-table-column label="月龄" align="center" prop="monthAge" width="80" />
|
||||||
<el-table-column label="产羔评分" align="center" prop="score" width="90" />
|
<el-table-column label="产羔评分" align="center" prop="score" width="90" />
|
||||||
@@ -267,6 +305,30 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="事件类型">
|
||||||
|
<el-input value="产羔" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="产羔日期" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="form.createTime"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择产羔日期"
|
||||||
|
style="width:100%">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="配种类型">
|
||||||
|
<el-input :value="getBreedTypeLabel(form.breedType)" placeholder="配种类型" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="公羊耳号" prop="maleEarNumber">
|
<el-form-item label="公羊耳号" prop="maleEarNumber">
|
||||||
@@ -279,6 +341,40 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<!-- 供体信息(胚胎移植时显示) -->
|
||||||
|
<template v-if="isEmbryoTransfer">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="供体母羊">
|
||||||
|
<el-input v-model="form.donorEwe" placeholder="供体母羊耳号" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="供体母羊品种">
|
||||||
|
<el-input v-model="form.donorEweBreed" placeholder="供体母羊品种" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="供体公羊">
|
||||||
|
<el-input v-model="form.donorRam" placeholder="供体公羊耳号" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="供体公羊品种">
|
||||||
|
<el-input v-model="form.donorRamBreed" placeholder="供体公羊品种" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="移胚数">
|
||||||
|
<el-input v-model="form.embryoCount" placeholder="移胚数" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="怀孕天数" prop="pregnancyDays">
|
<el-form-item label="怀孕天数" prop="pregnancyDays">
|
||||||
@@ -328,17 +424,6 @@
|
|||||||
<el-input v-model.number="form.score" placeholder="请输入产羔评分" type="number" />
|
<el-input v-model.number="form.score" placeholder="请输入产羔评分" type="number" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="产羔日期" prop="createTime">
|
|
||||||
<el-date-picker
|
|
||||||
clearable
|
|
||||||
v-model="form.createTime"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择产羔日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@@ -452,6 +537,13 @@
|
|||||||
<el-descriptions-item label="公羊耳号">{{ detailData.maleEarNumber }}</el-descriptions-item>
|
<el-descriptions-item label="公羊耳号">{{ detailData.maleEarNumber }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="公羊品种">{{ detailData.maleBreed }}</el-descriptions-item>
|
<el-descriptions-item label="公羊品种">{{ detailData.maleBreed }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="配种日期">{{ parseTime(detailData.breedingDate, '{y}-{m}-{d}') }}</el-descriptions-item>
|
<el-descriptions-item label="配种日期">{{ parseTime(detailData.breedingDate, '{y}-{m}-{d}') }}</el-descriptions-item>
|
||||||
|
<template v-if="detailData.donorEwe || detailData.donorRam">
|
||||||
|
<el-descriptions-item label="供体母羊">{{ detailData.donorEwe || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="供体母羊品种">{{ detailData.donorEweBreed || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="供体公羊">{{ detailData.donorRam || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="供体公羊品种">{{ detailData.donorRamBreed || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="移胚数">{{ detailData.embryoCount || '-' }}</el-descriptions-item>
|
||||||
|
</template>
|
||||||
<el-descriptions-item label="产羔数量">{{ detailData.lambsBorn }}</el-descriptions-item>
|
<el-descriptions-item label="产羔数量">{{ detailData.lambsBorn }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="活羔数量">{{ detailData.survival }}</el-descriptions-item>
|
<el-descriptions-item label="活羔数量">{{ detailData.survival }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="技术员">{{ detailData.technician }}</el-descriptions-item>
|
<el-descriptions-item label="技术员">{{ detailData.technician }}</el-descriptions-item>
|
||||||
@@ -539,6 +631,11 @@ const detailData = ref({})
|
|||||||
const lambDetailList = ref([])
|
const lambDetailList = ref([])
|
||||||
const varietyList = ref([]) // 品种列表
|
const varietyList = ref([]) // 品种列表
|
||||||
|
|
||||||
|
// 是否胚胎移植(有供体母羊或供体公羊信息时为true)
|
||||||
|
const isEmbryoTransfer = computed(() => {
|
||||||
|
return !!(form.value.donorEwe || form.value.donorRam)
|
||||||
|
})
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@@ -813,6 +910,19 @@ function getGenderDisplay(gender) {
|
|||||||
return { label: '未知', type: 'info' }
|
return { label: '未知', type: 'info' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 配种类型标签映射 */
|
||||||
|
function getBreedTypeLabel(breedType) {
|
||||||
|
const map = {
|
||||||
|
'1': '供体母羊配种',
|
||||||
|
'2': '同期发情人工授精',
|
||||||
|
'3': '本交',
|
||||||
|
'4': '自然发情人工授精',
|
||||||
|
'5': '胚胎移植'
|
||||||
|
}
|
||||||
|
if (breedType == null || breedType === '') return '-'
|
||||||
|
return map[String(breedType)] || String(breedType)
|
||||||
|
}
|
||||||
|
|
||||||
/** 母羊耳号输入处理 */
|
/** 母羊耳号输入处理 */
|
||||||
function handleEarNumberInput() {
|
function handleEarNumberInput() {
|
||||||
// 清空相关联动字段
|
// 清空相关联动字段
|
||||||
@@ -822,6 +932,12 @@ function handleEarNumberInput() {
|
|||||||
form.value.breedingDate = null
|
form.value.breedingDate = null
|
||||||
form.value.pregnancyDays = null
|
form.value.pregnancyDays = null
|
||||||
form.value.technician = null
|
form.value.technician = null
|
||||||
|
form.value.donorEwe = null
|
||||||
|
form.value.donorEweBreed = null
|
||||||
|
form.value.donorRam = null
|
||||||
|
form.value.donorRamBreed = null
|
||||||
|
form.value.embryoCount = null
|
||||||
|
form.value.breedType = null
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 母羊耳号失焦处理 - 自动查询配种信息 */
|
/** 母羊耳号失焦处理 - 自动查询配种信息 */
|
||||||
@@ -840,6 +956,13 @@ function handleEarNumberBlur() {
|
|||||||
form.value.breedingDate = breedingData.breeding_date
|
form.value.breedingDate = breedingData.breeding_date
|
||||||
form.value.pregnancyDays = breedingData.pregnancy_days
|
form.value.pregnancyDays = breedingData.pregnancy_days
|
||||||
form.value.technician = breedingData.technician || ''
|
form.value.technician = breedingData.technician || ''
|
||||||
|
// 供体信息(胚胎移植时有值)
|
||||||
|
form.value.donorEwe = breedingData.donor_ewe || null
|
||||||
|
form.value.donorEweBreed = breedingData.donor_ewe_breed || null
|
||||||
|
form.value.donorRam = breedingData.donor_ram || null
|
||||||
|
form.value.donorRamBreed = breedingData.donor_ram_breed || null
|
||||||
|
form.value.embryoCount = breedingData.embryo_count || null
|
||||||
|
form.value.breedType = breedingData.breed_type || null
|
||||||
const mVariety = varietyList.value.find(v => v.variety === breedingData.male_breed);
|
const mVariety = varietyList.value.find(v => v.variety === breedingData.male_breed);
|
||||||
const fVariety = varietyList.value.find(v => v.variety === breedingData.female_breed);
|
const fVariety = varietyList.value.find(v => v.variety === breedingData.female_breed);
|
||||||
|
|
||||||
@@ -874,10 +997,19 @@ function handleEarNumberBlur() {
|
|||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
listLambing_records(queryParams.value).then(response => {
|
listLambing_records(queryParams.value).then(response => {
|
||||||
lambing_recordsList.value = response.rows
|
const rows = response.rows || []
|
||||||
total.value = response.total
|
total.value = response.total
|
||||||
|
// 批量加载每行的羔羊详情
|
||||||
|
const promises = rows.map(row =>
|
||||||
|
getLambDetail(row.id).then(res => {
|
||||||
|
row.lambDetails = res.data || []
|
||||||
|
}).catch(() => { row.lambDetails = [] })
|
||||||
|
)
|
||||||
|
Promise.all(promises).then(() => {
|
||||||
|
lambing_recordsList.value = rows
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
}).catch(() => { loading.value = false })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
@@ -903,7 +1035,13 @@ function reset() {
|
|||||||
score: null,
|
score: null,
|
||||||
comment: null,
|
comment: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null
|
createTime: null,
|
||||||
|
donorEwe: null,
|
||||||
|
donorEweBreed: null,
|
||||||
|
donorRam: null,
|
||||||
|
donorRamBreed: null,
|
||||||
|
embryoCount: null,
|
||||||
|
breedType: null
|
||||||
}
|
}
|
||||||
showLambForms.value = false
|
showLambForms.value = false
|
||||||
lambForms.value = []
|
lambForms.value = []
|
||||||
@@ -936,6 +1074,8 @@ function handleSelectionChange(selection) {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset()
|
||||||
|
// 默认产羔日期为今天
|
||||||
|
form.value.createTime = new Date().toISOString().split('T')[0]
|
||||||
open.value = true
|
open.value = true
|
||||||
title.value = "添加产羔记录"
|
title.value = "添加产羔记录"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -605,12 +605,27 @@ function loadSheepTypeList() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchEarNumber(query) {
|
const searchEarNumber = async (query) => {
|
||||||
if (!query) { earOptions.value = []; return }
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
const res = await searchEarNumbers(query.trim())
|
||||||
}).finally(() => earLoading.value = false)
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function handlePaste() {
|
function handlePaste() {
|
||||||
nextTick(() => handlePasteSubmit())
|
nextTick(() => handlePasteSubmit())
|
||||||
|
|||||||
@@ -522,12 +522,27 @@ function loadVarietyOptions() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchEarNumber(query) {
|
const searchEarNumber = async (query) => {
|
||||||
if (!query) { earOptions.value = []; return }
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
const res = await searchEarNumbers(query.trim())
|
||||||
}).finally(() => earLoading.value = false)
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearEarNumbers() {
|
function clearEarNumbers() {
|
||||||
|
|||||||
@@ -540,12 +540,27 @@ function loadVarietyOptions() {
|
|||||||
varietyOptions.value = res.rows;
|
varietyOptions.value = res.rows;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function searchEarNumber(query) {
|
const searchEarNumber = async (query) => {
|
||||||
if (!query) { earOptions.value = []; return }
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
const res = await searchEarNumbers(query.trim())
|
||||||
}).finally(() => earLoading.value = false)
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function clearEarNumbers() {
|
function clearEarNumbers() {
|
||||||
queryParams.value.manageTagsList = []
|
queryParams.value.manageTagsList = []
|
||||||
|
|||||||
@@ -454,13 +454,27 @@ function getSheepfoldOptions() {
|
|||||||
sheepfoldOptions.value = res.rows
|
sheepfoldOptions.value = res.rows
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/* 远程搜耳号 */
|
const searchEarNumber = async (query) => {
|
||||||
function searchEarNumber(query) {
|
if (!query || query.trim() === '') {
|
||||||
if (!query) { earOptions.value = []; return }
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
const res = await searchEarNumbers(query.trim())
|
||||||
}).finally(() => earLoading.value = false)
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 清空所有耳号 */
|
/* 清空所有耳号 */
|
||||||
|
|||||||
@@ -497,12 +497,29 @@ function getSheepfoldOptions() {
|
|||||||
sheepfoldOptions.value = res.rows
|
sheepfoldOptions.value = res.rows
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function searchEarNumber(query) {
|
// 搜索耳号的方法(用于下拉框远程搜索)
|
||||||
if (!query) { earOptions.value = []; return }
|
const searchEarNumber = async (query) => {
|
||||||
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
// 调用API搜索耳号
|
||||||
}).finally(() => earLoading.value = false)
|
const res = await searchEarNumbers(query.trim())
|
||||||
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* 粘贴事件 */
|
/* 粘贴事件 */
|
||||||
function handlePaste() {
|
function handlePaste() {
|
||||||
|
|||||||
@@ -467,12 +467,29 @@ function getSheepfoldOptions() {
|
|||||||
sheepfoldOptions.value = res.rows
|
sheepfoldOptions.value = res.rows
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function searchEarNumber(query) {
|
// 搜索耳号的方法(用于下拉框远程搜索)
|
||||||
if (!query) { earOptions.value = []; return }
|
const searchEarNumber = async (query) => {
|
||||||
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
// 调用API搜索耳号
|
||||||
}).finally(() => earLoading.value = false)
|
const res = await searchEarNumbers(query.trim())
|
||||||
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* 粘贴事件 */
|
/* 粘贴事件 */
|
||||||
function handlePaste() {
|
function handlePaste() {
|
||||||
|
|||||||
@@ -629,7 +629,29 @@ function handleQuery() {
|
|||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
// 搜索耳号的方法(用于下拉框远程搜索)
|
||||||
|
const searchEarNumber = async (query) => {
|
||||||
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
earLoading.value = true
|
||||||
|
try {
|
||||||
|
// 调用API搜索耳号
|
||||||
|
const res = await searchEarNumbers(query.trim())
|
||||||
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
//重置搜索框
|
//重置搜索框
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
daterangeTransDate.value = [];
|
daterangeTransDate.value = [];
|
||||||
|
|||||||
@@ -769,12 +769,29 @@ function handleDelete(row) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchEarNumber(query) {
|
// 搜索耳号的方法(用于下拉框远程搜索)
|
||||||
if (!query) { earOptions.value = []; return }
|
const searchEarNumber = async (query) => {
|
||||||
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
// 调用API搜索耳号
|
||||||
}).finally(() => earLoading.value = false)
|
const res = await searchEarNumbers(query.trim())
|
||||||
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
async function handleRanchChange(ranchName) {
|
async function handleRanchChange(ranchName) {
|
||||||
if (!ranchName) {
|
if (!ranchName) {
|
||||||
|
|||||||
@@ -559,12 +559,27 @@ function filterSheepfold(query) {
|
|||||||
fold.sheepfoldName.includes(query)
|
fold.sheepfoldName.includes(query)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
function searchEarNumber(query) {
|
const searchEarNumber = async (query) => {
|
||||||
if (!query) { earOptions.value = []; return }
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
const res = await searchEarNumbers(query.trim())
|
||||||
}).finally(() => earLoading.value = false)
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function clearEarNumbers() {
|
function clearEarNumbers() {
|
||||||
queryParams.value.manageTagsList = []
|
queryParams.value.manageTagsList = []
|
||||||
|
|||||||
@@ -508,12 +508,27 @@ const fetchTechnicalList = () => {
|
|||||||
technicalOptions.value = []
|
technicalOptions.value = []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function searchEarNumber(query) {
|
const searchEarNumber = async (query) => {
|
||||||
if (!query) { earOptions.value = []; return }
|
if (!query || query.trim() === '') {
|
||||||
|
earOptions.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
earLoading.value = true
|
earLoading.value = true
|
||||||
searchEarNumbers(query.trim()).then(res => {
|
try {
|
||||||
earOptions.value = res.data || []
|
const res = await searchEarNumbers(query.trim())
|
||||||
}).finally(() => earLoading.value = false)
|
if (res.code === 200 && Array.isArray(res.data)) {
|
||||||
|
earOptions.value = res.data
|
||||||
|
} else {
|
||||||
|
earOptions.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('搜索耳号失败:', error)
|
||||||
|
earOptions.value = []
|
||||||
|
proxy.$modal.msgError('搜索耳号失败')
|
||||||
|
} finally {
|
||||||
|
earLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function clearEarNumbers() {
|
function clearEarNumbers() {
|
||||||
queryParams.value.manageTagsList = []
|
queryParams.value.manageTagsList = []
|
||||||
|
|||||||
Reference in New Issue
Block a user