生物安全模块羊只耳号查询修改
This commit is contained in:
@@ -42,3 +42,11 @@ export function delDeworm(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/biosafety/deworm/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,3 +42,12 @@ export function delDiagnosis(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/diagnosis/diagnosis/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delHealth(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/biosafety/health/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delImmunity(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/biosafety/immunity/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delQuarantine(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/biosafety/quarantine/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delTreatment(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/treatment/treatment/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delUsageInfo(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询耳号
|
||||
export function searchEarNumbers(query) {
|
||||
return request({
|
||||
url: '/biosafety/usageInfo/searchEarNumbers',
|
||||
method: 'get',
|
||||
params: { sheepNo: query }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -366,12 +366,11 @@
|
||||
|
||||
<script setup name="Deworm">
|
||||
import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
|
||||
import { listDeworm, getDeworm, delDeworm, addDeworm, updateDeworm } from '@/api/biosafety/deworm'
|
||||
import { listDeworm, getDeworm, delDeworm, addDeworm, updateDeworm, searchEarNumbers} from '@/api/biosafety/deworm'
|
||||
import { listPrescription, getPrescription } from '@/api/biosafety/prescription'
|
||||
import { listUnit } from '@/api/biosafety/unit'
|
||||
import { listUsage } from '@/api/biosafety/usage'
|
||||
import { listMedicine } from '@/api/biosafety/medicine'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
import request from '@/utils/request'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getUserByPost } from '@/api/common/user'
|
||||
@@ -476,29 +475,44 @@
|
||||
pasteInput.value = ''
|
||||
}
|
||||
|
||||
/** 远程搜索耳号 */
|
||||
|
||||
function searchEarNumber(query) {
|
||||
if (query !== '') {
|
||||
earNumberLoading.value = true
|
||||
|
||||
const queries = query.trim().split(/[\s,,]+/).filter(q => q)
|
||||
|
||||
if (queries.length === 1) {
|
||||
// 单个耳号模糊搜索
|
||||
searchEarNumbers(query).then(response => {
|
||||
earNumberOptions.value = response.data || []
|
||||
earNumberLoading.value = false
|
||||
}).catch(() => {
|
||||
earNumberOptions.value = []
|
||||
earNumberLoading.value = false
|
||||
})
|
||||
} else {
|
||||
// 多个耳号直接作为选项
|
||||
earNumberOptions.value = queries
|
||||
earNumberLoading.value = false
|
||||
}
|
||||
} else {
|
||||
if (!query || query.trim() === '') {
|
||||
earNumberOptions.value = []
|
||||
return
|
||||
}
|
||||
|
||||
earNumberLoading.value = true
|
||||
|
||||
// 统一转大写,去重
|
||||
const queries = [...new Set(
|
||||
query.trim().toUpperCase().split(/[\s,,]+/).filter(q => q.length >= 1)
|
||||
)]
|
||||
|
||||
if (queries.length === 0) {
|
||||
earNumberOptions.value = []
|
||||
earNumberLoading.value = false
|
||||
return
|
||||
}
|
||||
|
||||
if (queries.length === 1) {
|
||||
// 单个耳号模糊搜索
|
||||
searchEarNumbers(queries[0]).then(response => {
|
||||
earNumberOptions.value = response.data || []
|
||||
}).catch(() => {
|
||||
earNumberOptions.value = []
|
||||
}).finally(() => {
|
||||
earNumberLoading.value = false
|
||||
})
|
||||
} else {
|
||||
// 多个耳号:先显示,再后台校验
|
||||
earNumberOptions.value = queries.map(q => ({ label: q, value: q, validating: true }))
|
||||
earNumberLoading.value = false
|
||||
|
||||
// 可选:调用后端批量校验
|
||||
validateEarNumbers(queries).then(validList => {
|
||||
earNumberOptions.value = validList
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -269,16 +269,10 @@
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template><script setup name="Diagnosis">
|
||||
import {
|
||||
listDiagnosis,
|
||||
getDiagnosis,
|
||||
delDiagnosis,
|
||||
updateDiagnosis,
|
||||
} from '@/api/biosafety/diagnosis'
|
||||
import {listDiagnosis,getDiagnosis,delDiagnosis,updateDiagnosis,searchEarNumbers} from '@/api/biosafety/diagnosis'
|
||||
import { listSheepfold_management } from '@/api/fileManagement/sheepfold_management'
|
||||
import { listDisease } from '@/api/biosafety/disease'
|
||||
import { getCurrentInstance, onMounted, ref, watch } from 'vue'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
import { getUserByPost } from '@/api/common/user'
|
||||
|
||||
const technicalOptions = ref([]) //自定义技术员数组变量
|
||||
|
||||
@@ -374,14 +374,13 @@
|
||||
|
||||
<script setup name="Health">
|
||||
import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
|
||||
import { listHealth, getHealth, delHealth, addHealth, updateHealth } from '@/api/biosafety/health'
|
||||
import { listHealth, getHealth, delHealth, addHealth, updateHealth,searchEarNumbers } from '@/api/biosafety/health'
|
||||
import { listPrescription, getPrescription } from '@/api/biosafety/prescription'
|
||||
import { listUnit } from '@/api/biosafety/unit'
|
||||
import { listUsage } from '@/api/biosafety/usage'
|
||||
import { listMedicine } from '@/api/biosafety/medicine'
|
||||
import request from '@/utils/request'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
import { getUserByPost } from '@/api/common/user'
|
||||
|
||||
const technicalOptions = ref([]) //自定义技术员数组变量
|
||||
|
||||
@@ -371,14 +371,13 @@
|
||||
|
||||
<script setup name="Immunity">
|
||||
import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
|
||||
import { listImmunity, getImmunity, delImmunity, addImmunity, updateImmunity } from '@/api/biosafety/immunity'
|
||||
import { listImmunity, getImmunity, delImmunity, addImmunity, updateImmunity,searchEarNumbers } from '@/api/biosafety/immunity'
|
||||
import { listPrescription, getPrescription } from '@/api/biosafety/prescription'
|
||||
import { listUnit } from '@/api/biosafety/unit'
|
||||
import { listUsage } from '@/api/biosafety/usage'
|
||||
import { listMedicine } from '@/api/biosafety/medicine'
|
||||
import request from '@/utils/request'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
import { getUserByPost } from '@/api/common/user'
|
||||
|
||||
const technicalOptions = ref([]) //自定义技术员数组变量
|
||||
|
||||
@@ -399,19 +399,12 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Quarantine">
|
||||
import {
|
||||
listQuarantine,
|
||||
getQuarantine,
|
||||
delQuarantine,
|
||||
addQuarantine,
|
||||
updateQuarantine
|
||||
} from '@/api/biosafety/quarantine'
|
||||
import {listQuarantine,getQuarantine,delQuarantine,addQuarantine,updateQuarantine,searchEarNumbers} from '@/api/biosafety/quarantine'
|
||||
import { listItems } from '@/api/biosafety/items'
|
||||
import { listSample } from '@/api/biosafety/sample'
|
||||
import request from '@/utils/request'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
import { getUserByPost } from '@/api/common/user'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
@@ -528,7 +528,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
|
||||
import { listTreatment, getTreatment, delTreatment, addTreatment, updateTreatment } from '@/api/biosafety/treatment'
|
||||
import { listTreatment, getTreatment, delTreatment, addTreatment, updateTreatment,searchEarNumbers } from '@/api/biosafety/treatment'
|
||||
import { listDisease } from '@/api/biosafety/disease'
|
||||
import { listSheepfold_management } from "@/api/fileManagement/sheepfold_management"
|
||||
import { listPrescription, getPrescription } from '@/api/biosafety/prescription'
|
||||
@@ -537,7 +537,6 @@ import { listUsage } from '@/api/biosafety/usage'
|
||||
import { listMedicine } from '@/api/biosafety/medicine'
|
||||
import request from '@/utils/request'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
import { getUserByPost } from '@/api/common/user'
|
||||
|
||||
const technicalOptions = ref([]) //自定义技术员数组变量
|
||||
|
||||
@@ -202,11 +202,10 @@
|
||||
|
||||
<script setup name="Usage">
|
||||
import { listMedicine} from "@/api/biosafety/medicine"
|
||||
import { listUsageInfo, getUsageInfo } from '@/api/biosafety/usageInfo'
|
||||
import { listUsageInfo, getUsageInfo,searchEarNumbers } from '@/api/biosafety/usageInfo'
|
||||
import { listUnit } from '@/api/biosafety/unit'
|
||||
import { listUsage } from '@/api/biosafety/usage'
|
||||
import { getCurrentInstance, reactive, ref, toRefs } from 'vue'
|
||||
import { searchEarNumbers } from '@/api/common/sheep'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { pres_type } = proxy.useDict('pres_type')
|
||||
|
||||
Reference in New Issue
Block a user