From 87782640a22226c79307226d89d69a6866485f1f Mon Sep 17 00:00:00 2001 From: zyh <2066096076@qq.com> Date: Tue, 3 Feb 2026 14:43:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=9C=BA=EF=BC=8C=E8=BD=AC=E7=BE=A4?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E8=80=B3=E5=8F=B7=EF=BC=8C=E6=94=B9=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=EF=BC=8C=E6=94=B9=E5=93=81=E7=A7=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D=EF=BC=8C=E5=AD=97=E6=AE=B5=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/produce/bodyManage/body_measure.js | 8 + .../produce/bodyManage/body_measure/index.vue | 300 ++++++++-- .../produce/bodyManage/body_score/index.vue | 133 ++++- .../bodyManage/breast_rating/index.vue | 129 ++++- .../produce/manage_sheep/add_sheep/index.vue | 10 +- .../manage_sheep/changeComment/index.vue | 297 +++++++--- .../produce/manage_sheep/changeEar/index.vue | 173 ++++-- .../manage_sheep/changeVariety/index.vue | 312 ++++++++--- .../manage_sheep/trans_group/index.vue | 428 ++++++++++---- .../manage_sheep/transition_info/index.vue | 529 +++++++++++------- src/views/produce/other/castrate/index.vue | 129 ++++- src/views/produce/other/fixHoof/index.vue | 129 ++++- 12 files changed, 1954 insertions(+), 623 deletions(-) diff --git a/src/api/produce/bodyManage/body_measure.js b/src/api/produce/bodyManage/body_measure.js index 1f3da3a..32529e4 100644 --- a/src/api/produce/bodyManage/body_measure.js +++ b/src/api/produce/bodyManage/body_measure.js @@ -57,4 +57,12 @@ export function searchEarNumbers(query) { method: 'get', params: { query } }) +} + +// 获取繁殖状态列表 +export function listBreedStatus() { + return request({ + url: '/body_measure/body_measure/breedStatus', + method: 'get' + }) } \ No newline at end of file diff --git a/src/views/produce/bodyManage/body_measure/index.vue b/src/views/produce/bodyManage/body_measure/index.vue index e00aecf..6458867 100644 --- a/src/views/produce/bodyManage/body_measure/index.vue +++ b/src/views/produce/bodyManage/body_measure/index.vue @@ -10,19 +10,45 @@ start-placeholder="开始日期" end-placeholder="结束日期"> - - - - - 清空 - +
+ + + + + + + + 已选: {{ queryParams.manageTagsList.length }} 个 + + + 清空全部 + +
+
+ + {{ tag }} + + + {{ isExpanded ? '收起' : `展开剩余 ${queryParams.manageTagsList.length - defaultShowCount} 个` }} + + + + +
- - - + + + + + @@ -30,23 +56,49 @@ - - + +
+ + - + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 - 重置 + -
- 已选耳号: - - {{ tag }} - -
导出 + + 导入 + @@ -73,7 +129,12 @@ - + + + + \ No newline at end of file diff --git a/src/views/produce/bodyManage/body_score/index.vue b/src/views/produce/bodyManage/body_score/index.vue index 4248d05..1fbce12 100644 --- a/src/views/produce/bodyManage/body_score/index.vue +++ b/src/views/produce/bodyManage/body_score/index.vue @@ -6,15 +6,39 @@ start-placeholder="开始日期" end-placeholder="结束日期">
- - - - - 清空 - +
+ + + + + + + + 已选: {{ queryParams.manageTagsList.length }} 个 + + + 清空全部 + +
+
+ + {{ tag }} + + + {{ isExpanded ? '收起' : `展开剩余 ${queryParams.manageTagsList.length - defaultShowCount} 个` }} + + + + +
@@ -26,18 +50,18 @@ + + + + + + + 搜索 - 重置 + -
- 已选耳号: - - {{ tag }} - -
\ No newline at end of file diff --git a/src/views/produce/bodyManage/breast_rating/index.vue b/src/views/produce/bodyManage/breast_rating/index.vue index b34bc16..a02281d 100644 --- a/src/views/produce/bodyManage/breast_rating/index.vue +++ b/src/views/produce/bodyManage/breast_rating/index.vue @@ -10,15 +10,39 @@ start-placeholder="开始日期" end-placeholder="结束日期"> - - - - - 清空 - +
+ + + + + + + + 已选: {{ queryParams.manageTagsList.length }} 个 + + + 清空全部 + +
+
+ + {{ tag }} + + + {{ isExpanded ? '收起' : `展开剩余 ${queryParams.manageTagsList.length - defaultShowCount} 个` }} + + + + +
@@ -30,9 +54,16 @@ + + + + + + + 搜索 - 重置 + @@ -54,13 +85,6 @@
-
- 已选耳号: - - {{ tag }} - -
@@ -151,7 +175,9 @@ import { listBreast_rating, getBreast_rating, delBreast_rating, addBreast_rating import { checkSheepByManageTags, getVarietyOptions } from "@/api/produce/other/fixHoof" import { listSheepfold_management as listSheepfold } from '@/api/fileManagement/sheepfold_management' import { getCurrentInstance, reactive, ref } from "vue" - +import { Plus, Delete, ArrowUp, ArrowDown } from '@element-plus/icons-vue' +import { nextTick } from 'vue' +import dayjs from 'dayjs' const { proxy } = getCurrentInstance() const breast_ratingList = ref([]) @@ -166,7 +192,14 @@ const title = ref("") const daterangeCreateTime = ref([]) const daterangeEventDate = ref([]); const isAdd = ref(false) - +const pasteText = ref('') +const isExpanded = ref(false) +const defaultShowCount = 2 +const displayedEarTags = computed(() => { + const list = queryParams.value.manageTagsList + if (isExpanded.value || list.length <= defaultShowCount) return list + return list.slice(0, defaultShowCount) +}) const data = reactive({ form: { id: null, @@ -184,7 +217,9 @@ const data = reactive({ queryParams: { pageNum: 1, pageSize: 20, - manageTags: null + manageTags: null, + manageTagsList: [], + isDelete: null }, rules: { manageTags: [ @@ -285,8 +320,9 @@ function handleQuery() { /** 重置按钮操作 */ function resetQuery() { daterangeCreateTime.value = [] - daterangeEventDate.value = []; + daterangeEventDate.value = [] queryParams.value.manageTagsList = [] + queryParams.value.isDelete = null proxy.resetForm("queryRef") handleQuery() } @@ -304,6 +340,7 @@ function handleAdd() { isAdd.value = true open.value = true title.value = "添加乳房评分" + form.value.eventDate = dayjs().format('YYYY-MM-DD') } /** 修改按钮操作 */ @@ -386,10 +423,42 @@ function searchEarNumber(query) { function clearEarNumbers() { queryParams.value.manageTagsList = [] } + function removeEarNumber(tag) { const idx = queryParams.value.manageTagsList.indexOf(tag) if (idx > -1) queryParams.value.manageTagsList.splice(idx, 1) } +function handlePaste() { + nextTick(() => handlePasteSubmit()) +} + +function handlePasteSubmit() { + if (!pasteText.value.trim()) return + const separators = /[\s,,\n\r\t]+/ + const raw = pasteText.value.trim().split(separators).filter(v => v) + const exist = new Set(queryParams.value.manageTagsList) + const adds = [] + const dups = [] + raw.forEach(v => { + if (!exist.has(v)) { adds.push(v); exist.add(v) } + else dups.push(v) + }) + if (adds.length) { + queryParams.value.manageTagsList = [...queryParams.value.manageTagsList, ...adds] + proxy.$modal.msgSuccess(`成功添加 ${adds.length} 个耳号${dups.length ? `,已忽略 ${dups.length} 个重复` : ''}`) + } else if (dups.length) { + proxy.$modal.msgWarning('所有耳号均已存在') + } + pasteText.value = '' +} + +function toggleExpand() { + isExpanded.value = !isExpanded.value +} + +function handleEarChange(val) { + queryParams.value.manageTagsList = [...new Set(val)] +} onMounted(() => { loadVarietyOptions() getSheepfoldOptions() @@ -398,9 +467,23 @@ onMounted(() => { \ No newline at end of file diff --git a/src/views/produce/manage_sheep/add_sheep/index.vue b/src/views/produce/manage_sheep/add_sheep/index.vue index ede094f..0e84b67 100644 --- a/src/views/produce/manage_sheep/add_sheep/index.vue +++ b/src/views/produce/manage_sheep/add_sheep/index.vue @@ -1,7 +1,7 @@